Here is the request I make to import a test result into an XRay Test item in Jira.
curl -L 'https://jira.[xyz].com/rest/raven/2.0/import/execution' -H 'Authorization: Basic Z3V5bDoyNDIxQmxlaWdo' -H 'Content-Type: application/json' -H 'Cookie: JSESSIONID=8A29ED3A4C045C60DACF236DAF8EDA9E; atlassian.xsrf.token=BFS8-LR8B-Z1EU-6YVL_f235c7a5028addccb3a41945753385105b205e1b_lin' -d '{
"tests": [
{
"testKey": "NCS-55808",
"start": "2023-03-09T07:43+23:95",
"finish": "2023-03-09T07:43+24:95",
"status": "PASS",
"comment": "OK",
"customfield_14000": {
"id": 14000,
"value": "Automation"
}
}
]
}'
The result I get is:
{
"error": "Error instantiating bean. Field(s) tests -> customfield_14000 do not follow the correct format."
}
customfield_14000
is defined in our Jira instance as "Capacity Category".
I got the same result when trying "Capacity Category" instead of "customfield_14000".
What Else I Tried - Multipart
I also tried the multipart
API.
issueFields.json
:
{
"project": {
"id": "10006"
},
"fields": {
"summary": "new test execution",
"customfield_14000": [
"Automation"
]
}
}
Result was:
{
"error": "Error assembling issue data: project is required"
}
And I did verify it is the correct ID.