DEV Community

Orbit A
Orbit A

Posted on

How to Send Cypress Results Directly to Jira Tickets

Your Cypress E2E suite just finished running in your CI/CD pipeline. It caught a regression. Great job!

But what happens next? If your team is like most, the QA engineer has to open the GitHub Actions or Jenkins logs, figure out which spec failed, take a screenshot, and manually paste it into the developer’s Jira ticket with a comment like: “Hey, this broke in the latest build. Here is the link to the logs.

Cypress is an incredible tool for writing reliable End-to-End tests. But when it comes to communicating those results across the team, the feedback loop is often broken. Developers and Product Managers live in Jira, not in your CI logs.

Let’s look at how to bridge this gap and push Cypress results exactly where the work is happening.

The Old Way: Manual Links and Expensive Dashboards

Historically, teams have tried to solve this in a few ways:

  1. Pasting links: Manually linking to CI logs or HTML reports (like Mochawesome) in Jira comments. It’s tedious, and nobody actually clicks those links.
  2. Building custom integrations: Writing complex Node.js scripts using Atlassian API tokens to format Jira comments. These scripts take days to build and constantly break when tokens expire.
  3. Paying for external dashboards: Using premium cloud dashboards that developers rarely log into anyway because it forces them to context-switch out of Atlassian.

The Smart New Way: Direct Jira Issue Webhooks

Software quality should be visible right inside the Jira ticket that the developer is actively working on.

To solve this, our team at Orbit A built the Cypress Test Results for Jira -> Link to Atlassian Marketplace Is Here! It is a native, zero-config Atlassian Forge app that allows you to push Cypress test results directly into the Jira Issue Panel using a simple Webhook.

No API tokens to manage. No complex formatting. Just a simple JSON payload. Here is how to set it up.

Step-by-Step Guide

Step 1: Install the App
Head over to the Atlassian Marketplace and install the Cypress Test Results for Jira (it’s free to try).
Step 2: Generate Your Webhook
Go to your Jira Apps menu and open the Cypress to Jira page. The app will securely generate:

  • A Webhook URL.
  • A Secret Token.

config page

Step 3: Add a POST Request to Your CI Pipeline
Once your Cypress tests finish running, you usually have a JSON report (for example, generated by Mochawesome or a custom Cypress reporter). You can simply parse that report and send it to Jira using Node.js or curl.

Here is an example of a simple Node.js script you can run in your after:run hook or as a separate CI step:

// cypress-jira-reporter.js
const Mocha = require('mocha');
const { EVENT_RUN_END, EVENT_TEST_PASS, EVENT_TEST_FAIL, EVENT_TEST_PENDING } = Mocha.Runner.constants;

class JiraReporter extends Mocha.reporters.Base {
  constructor(runner, options) {
    super(runner);

    const reporterOptions = options.reporterOptions || {};
    const issueId = reporterOptions.issueId || process.env.JIRA_ISSUE_ID;
    const webhookUrl = reporterOptions.webhookUrl || process.env.JIRA_WEBHOOK_URL;
    const token = reporterOptions.token || process.env.JIRA_WEBHOOK_TOKEN;

    const stats = { passed: 0, failed: 0, skipped: 0, duration: 0 };
    const tests = [];

    runner.on(EVENT_TEST_PASS, (test) => {
      stats.passed++;
      tests.push({ title: test.title, status: 'passed', duration: test.duration || 0 });
    });

    runner.on(EVENT_TEST_FAIL, (test) => {
      stats.failed++;
      tests.push({ title: test.title, status: 'failed', duration: test.duration || 0 });
    });

    runner.on(EVENT_TEST_PENDING, (test) => {
      stats.skipped++;
      tests.push({ title: test.title, status: 'skipped', duration: 0 });
    });

    runner.on(EVENT_RUN_END, async () => {
      stats.duration = Date.now() - this.startTime;

      const overallStatus = stats.failed > 0 ? 'failed' : 'passed';

      const payload = {
        token: token,
        issueId: issueId,
        status: overallStatus,
        summary: stats,
        tests: tests
      };

      if (!webhookUrl || !token || !issueId) {
         console.warn('\n[Jira Reporter] ⚠️ Missing Webhook URL, Token, or Issue ID. Skipping Jira update.');
         return;
      }

      console.log('\n[Jira Reporter] Sending results to Jira issue:', issueId);

      try {
        await fetch(webhookUrl, {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(payload)
        });
        console.log('[Jira Reporter] ✅ Successfully pushed results to Jira!');
      } catch (e) {
        console.error('[Jira Reporter] ❌ Error sending payload to Jira:', e);
      }
    });

    this.startTime = Date.now();
  }
}

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:

  1. Open the Jira Issue you are testing.
  2. Look at the URL in your browser.
  3. If you are on a Board: You will see ...&selectedIssue=10023. The number is the ID.
  4. 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)

jira numeric issue id

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: Total Visibility

The moment your CI pipeline finishes, any developer or PM opening the Jira ticket will instantly see this on the right-side panel:

hero screenshot

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:

detailed screenshot

Conclusion

By integrating Cypress directly with Jira, you eliminate context-switching. QA engineers stop acting as log-couriers, and developers get immediate feedback exactly where they track their work.

👉 Try Cypress Test Results for Jira on the Atlassian Marketplace -> Link to Atlassian Marketplace!

If you found this helpful, be sure to follow Orbit A on LinkedIn. We are building a suite of tools to bridge the gap between testing and project management, including native integrations for Playwright, k6, and JMeter!

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.