I did some research on Jira and Xray side.
In Xray server, when using the so called "cucumber multipart" endpoint, a new Test Execution issue will always be created. You can specify a JSON content that contains a "fields" JSON object where you can set the values for some of the custom fields you have on the Test Execution (e.g. the "summary" or other).
Bellow, you may find an example of the auxiliary JSON object (stored in a file for example createTestExec_with_description.json).
You can define the description field and embed there a link. This follows the "simple update" syntax of Jira, as described here.
However, you cannot add a comment while the issue is being created (this is a "limitation"/decision of Jira REST API when you invoke the creation of Jira issues).
{
"fields": {
"project": {
"key": "BOOK"
},
"summary": "Results for cucumber execution",
"description": "For more info please check [here|https://www.example.com]",
"issuetype": {
"id": "9"
},
"customfield_11805" : [
"iOS"
],
"fixVersions" :
[
{
"name": "1.0"
}
]
}
}
Then you can submit you cucumber JSON report plus this auxiliary file using something like:
curl -u $USERNAME:$PASSWORD -F info=@createTestExec_with_description.json -F result=@data.json $JIRA_BASE_URL/rest/raven/1.0/import/execution/cucumber/multipart
If you're using Xray on Jira Cloud, Xray's API allows to specify an existing Test Execution issue to update/overwrite. I didn't check if you can use a mix of "simple" and "verb/operation" updates, as Atlassian refers to them in the docs (i.e. use the "fields" object plus and "update" object at the same time).
If that was possible, you would probably do something like:
{
"fields": {
"project": {
"key": "BOOK"
},
"summary": "Results for cucumber execution",
"description": "For more info please check [here|https://www.example.com]",
"issuetype": {
"id": "9"
},
"customfield_11805" : [
"iOS"
],
"fixVersions" :
[
{
"name": "1.0"
}
]
},
"update": {
"comment": [
{
"add": {
"body": "latest results [here|https://www.example.com]"
}
}
]
}
}
The previous examples have some fields that you can safely remove, depending on your needs. You'll also to adapt them to your Jira configuration/environment.