DEV Community

Orbit A
Orbit A

Posted on

The Ultimate Guide to Tracking Playwright Automation Results in Jira Issues

You wrote a beautiful, rock-solid Playwright test suite. It caught a critical bug in the CI pipeline. Splendid!

…And then you spend the next 15 minutes explaining to the developer which pipeline ran, where to find the logs, and manually pasting screenshots of the failed assertions into a Jira ticket. Not awesome.

If your team uses Playwright, you know it’s incredibly fast and reliable. But communicating those test results across the team is still a manual, context-switching nightmare. Software quality shouldn’t live in a siloed CI/CD black hole — it should live exactly where your team tracks their work: in Jira.

Let’s look at how to fix this workflow once and for all.

The Hard Way: Custom Scripts and Jira API Nightmares

Usually, when QA engineers or DevOps teams try to automate sending test results to Jira, they go down the rabbit hole of building custom integrations:

  1. Creating Atlassian API tokens (which eventually expire and break the pipeline).
  2. Writing complex Node.js scripts to parse Playwright’s JSON reports.
  3. Wrestling with Jira’s Atlassian Document Format (ADF) just to format a simple table in a comment.

It takes days to build and constantly requires maintenance.

The Smart Way: Webhook Integration

Instead of building a custom integration from scratch, you can use a native Atlassian Forge app that does the heavy lifting for you.

My team at Orbit A recently released the Playwright Results for Jira >>> Link to Atlassian Marketplace. It’s a zero-config app that generates a secure Webhook URL for your Jira project. You just send a simple JSON payload to this URL, and it instantly renders beautiful charts and tables right inside the Jira Issue Panel.

Here is how you can set it up in under 2 minutes.

Step-by-Step Guide

Step 1: Install the App
Head over to the Atlassian Marketplace and install the Playwright Integration for Jira (it’s free to try).

Step 2: Generate Your Webhook
Once installed, go to your Jira Apps menu and open the Playwright Configuration page. Click “Generate Webhook”. You will get two things:

  • A Webhook URL.

  • A secure Token.

config page

Step 3: Add a Simple POST Request to Your Pipeline
You don’t need any complex dependencies. After your Playwright tests finish running (and generate a JSON report), you can use a simple Node script or a curl command to push the data to Jira.

  1. Create a file named jira-reporter.js in your Playwright project root.
  2. Paste the code below into it.
  3. Run tests: JIRA_ISSUE_ID=10001 npx playwright test --reporter=./jira-reporter.js
// jira-reporter.js
class JiraReporter {
  constructor(options) {
    this.issueId = options.issueId || process.env.JIRA_ISSUE_ID;
  }

  onBegin(config, suite) {
    this.suite = suite;
    this.startTime = Date.now();
  }

  async onEnd(result) {
    const duration = Date.now() - this.startTime;
    const stats = {
      passed: 0, failed: 0, skipped: 0, duration: duration
    };
    const tests = [];

    const traverse = (suite) => {
      for (const test of suite.tests) {
        const outcome = test.results[test.results.length - 1];
        if (!outcome) continue;

        if (outcome.status === 'passed') stats.passed++;
        if (outcome.status === 'failed' || outcome.status === 'timedOut') stats.failed++;
        if (outcome.status === 'skipped') stats.skipped++;

        tests.push({
          title: test.title,
          projectName: test.parent?.project()?.name || 'unknown',
          status: outcome.status,
          duration: outcome.duration
        });
      }
      for (const child of suite.suites) traverse(child);
    };
    traverse(this.suite);

    const payload = {
      token: "Loading...",
      issueId: this.issueId,
      summary: stats,
      tests: tests
    };

    console.log('Sending report to Jira...');
    try {
      await fetch('Loading...', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(payload)
      });
      console.log('Successfully sent to Jira!');
    } catch (e) {
      console.error('Failed to send to Jira:', e);
    }
  }
}
module.exports = JiraReporter;
Enter fullscreen mode Exit fullscreen mode

(Important: Please ensure issueId is the numeric ID, e.g., 10023, not the Key like PROJ-1)
How to find the Numeric Issue ID:

  • Open the Jira Issue you are testing.
  • Look at the URL in your browser. — If you are on a Board: You will see ...&selectedIssue=10023. The number is the ID. — If you are in the direct issue view: You can navigate to Jira ticket → click ‘Actions’ button → click ‘Export XML’ → copy value of ‘key_id’, i.e. KAN-7 (here you’ll need to copy 10134)

issueID example

Note: You can trigger this script in your GitHub Actions, GitLab CI, or Jenkins pipeline dynamically passing the current Jira Issue ID based on the branch name!

The Result: No More Context Switching
As soon as the pipeline finishes, the developer or PM opening the Jira ticket will see this immediately on the right-side panel:

main page

They don’t need to ask for test results history. They can click on the Select Run tab to see 5 latest test runs and their results:

select run feature

Conclusion
Stop acting as a human bridge between your CI/CD pipelines and Jira. By pushing Playwright results directly into Atlassian, you save time, reduce friction between QA and Development, and make software quality visible to everyone.

👉 Try Playwright Integration for Jira on the Atlassian Marketplace >>> Here is the Link

If you found this helpful, follow Orbit A on LinkedIn https://www.linkedin.com/company/orbit-a-apps/ for more tips on bridging the gap between testing and project management. We also have native integrations for Cypress, k6, and JMeter!

Top comments (0)