Jenkins builds failing to update test case status in Jira

Our Jenkins pipeline completes successfully but test results aren’t syncing to Jira test case status. We’re running Jira 8 with the JUnit reporter plugin, and while Jenkins shows all tests passed, the corresponding test cases in Jira remain in “Not Executed” status.

The pipeline generates JUnit XML reports correctly:

<testcase name="UserLoginTest" classname="com.app.tests">
  <system-out>Test passed</system-out>
</testcase>

We’ve configured the Jira Test Result Reporter post-build action with our Jira credentials and project key, but no updates are happening. This is blocking our release approval process since QA can’t verify test coverage in Jira. Any ideas what might be preventing the test result attachment?

I’ve dealt with this issue before. The JUnit XML format matters a lot. Jira expects specific attributes in the test case elements to map results correctly. Your XML snippet is missing the time attribute and the test case ID reference. The plugin needs to know which Jira test case corresponds to each JUnit test. Are you using custom fields or labels to link Jenkins tests to Jira test case IDs? Without that mapping, the plugin can’t update the right test cases in Jira.

Your test synchronization failure involves three critical components that must align for proper Jenkins-to-Jira test result flow.

JUnit Reporter Plugin Configuration: The plugin requires explicit mapping between JUnit test results and Jira test case keys. Your current XML structure lacks the necessary linking metadata. Update your test framework to include Jira test case keys as properties:

<testcase name="UserLoginTest" classname="com.app.tests" time="2.5">
  <properties>
    <property name="test_key" value="TEST-456"/>
  </properties>
</testcase>

This allows the JUnit reporter to identify which Jira test case to update. Alternatively, encode the test key in the test name itself: TEST-456_UserLoginTest.

Test Result Attachment: The Jira Test Result Reporter plugin in Jenkins needs proper configuration in your pipeline. For declarative pipelines, use:

post {
  always {
    junit '**/target/surefire-reports/*.xml'
    jiraTestResultReporter(
      projectKey: 'PROJ',
      testResultsPattern: '**/surefire-reports/*.xml'
    )
  }
}

Verify the plugin is processing the JUnit XML files by checking Jenkins console output for messages like “Publishing test results to Jira” or error messages indicating parsing failures.

REST API Permissions: Your Jenkins service account in Jira requires specific permissions beyond basic project access:

  1. Project Permission: “Edit Issues” for the test management project
  2. Global Permission: “Create Attachments” to upload test result files
  3. Custom Permission: If using Zephyr or Xray, ensure the account has “Execute Tests” permission

Verify permissions by testing the REST API manually from Jenkins:

curl -u jenkins_user:api_token \
  https://jira.company.com/rest/api/2/issue/TEST-456

If this returns 403 or authentication errors, your permission configuration is the root cause.

Additional Troubleshooting Steps:

  1. Enable debug logging in Jenkins (Manage Jenkins → System Log) for com.atlassian.jira to see detailed API calls
  2. Check if your Jira instance has API rate limiting enabled - bulk test updates might be throttled
  3. Verify the test case custom field configuration in Jira matches what the plugin expects (status field must be editable)
  4. For Jira 8, ensure you’re using JUnit Reporter plugin version 2.x or higher for compatibility

The “Not Executed” status persisting after successful builds indicates the API calls aren’t reaching Jira or are being rejected silently. Once you implement the property-based test key mapping and verify permissions, test with a single test case update before running full pipeline test suites.

Check the Jenkins console output for any authentication errors when the plugin tries to connect to Jira. Even if the credentials are configured, there might be network issues or API rate limiting preventing the updates. I’d also recommend testing the Jira REST API connection manually from the Jenkins server using curl to rule out connectivity problems. The “Not Executed” status suggests the plugin isn’t reaching Jira at all, rather than updating with wrong values.

First thing to check - does your Jenkins service account have the necessary REST API permissions in Jira? The account needs “Browse Projects”, “Edit Issues”, and “Transition Issues” permissions for the target project. Also verify the Jira Test Result Reporter plugin version is compatible with Jira 8.

Good point about the mapping. We’re using test case keys in the test method annotations, but maybe the plugin isn’t reading them. How do we configure the ID mapping between Jenkins test names and Jira test case keys?

The mapping typically happens through test case naming conventions or custom properties in the JUnit XML. You need to include the Jira test case key (like TEST-123) somewhere the plugin can parse it - either in the test name itself or as a property element. Also check if your Jenkins pipeline is actually executing the post-build action. Sometimes pipeline syntax issues cause post-build steps to be skipped silently. Add explicit logging in your Jenkinsfile to confirm the Jira update step is being reached.