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:
- Project Permission: “Edit Issues” for the test management project
- Global Permission: “Create Attachments” to upload test result files
- 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:
- Enable debug logging in Jenkins (Manage Jenkins → System Log) for
com.atlassian.jira to see detailed API calls
- Check if your Jira instance has API rate limiting enabled - bulk test updates might be throttled
- Verify the test case custom field configuration in Jira matches what the plugin expects (status field must be editable)
- 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.