Search code examples
jenkinsjenkins-pluginsjirajira-rest-apijira-xray

How to update a test execution when importing Junit Multipart using Xray?


I was looking at the documentation of the Xray plugin for Jenkins: https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST#ImportExecutionResultsREST-JUnitXMLresultsMultipart

And what I found, is a bit confusing, after a few attempts. If I'm NOT trying to import executions using the multipart, I can update a test execution by specifying a Test Execution Key.

When I do try the multipart, I have this JSON

 "fields": {
   "project": {
     "key": "${ProjectKey}"
   },
   "summary": "Temp Test execution",
   "issuetype": {
     "name": "Test Execution"
   },
   "labels": [],
   "fixVersions": [
     {
       "name": "testrelease"
     }
   ]
 }
}

This always creates a new Test Execution within JIRA. In their examples I see no way to send the test execution key for it to be updated. Which is strange, because by importing without multipart, I can set it.

Anyone has any idea how to achieve this?


Solution

  • Currently, if you use the "multipart" kind of endpoints, a new Test Execution will always be created. To update existing Test Execution issues you need to use the standard endpoints (e.g., JUnit); however, these don't allow you to customize fields on the Test Execution. There's an improvement in the backlog in order to enhance the existing behaviour; please vote on it and watch it, so the Xray team can become aware of your interest on this.