Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create test execution using API with versions and other custom fields

Singa Selva Sankar
Contributor
April 23, 2022

I am trying to create test execution using API '/rest/raven/1.0/import/execution' with payload details provided in the documentation, test execution getting created. when I add fields like 'testCategoryId, fixVersion, versions, labels' I am getting the following error message "

Error instantiating bean. Field(s) info -> fixVersions do not follow the correct format." 
I used the following formats for all the fields but getting the same error.
testCategoryId: "test category value"
testCategoryId: {"value":"test category value"}
testCategoryId: [{"test category value"}]
testCategoryID: [{"value":"test category value""}]
I don't find anything on the documentation regarding the format of data that we use when using against the API.

 

1 answer

1 accepted

0 votes
Answer accepted
Stefan Salzl
Community Champion
April 24, 2022

Hi @Singa Selva Sankar 

Could you please provide your payload you are trying to create an issue?

It‘s just saying the fixVersion field is not matching format. What did you try to fill in this field?

Best
Stefan

Singa Selva Sankar
Contributor
April 25, 2022

Hi @Stefan Salzl adding my payload. I am trying to have values for following fields

  • testCategoryId
  • components
  • versions
  • fixVersions
  • labels

I tried the input variations which I mentioned in my questions for the fields I mentioned above, but none creating successfully.


{
"info": {
"summary": "Execution of automated tests for release v1.0",
"description": "This execution is automatically created when importing execution results from an external source",
"user": "sm72",
"startDate": "2022-01-20T14:44:43Z",
"finishDate": "2022-01-20T14:44:43Z",
"projectKey": "AAAB",
"testEnvironments": [
"Windows"
],
"testcategoryId": "System Test",
"components": "EAT",
"versions": [{
"name": "v 1"
}],
"fixVersions": [{
"name": "v 1"
}],
"labels": ["mobile"]
},
"tests": [{
"testType": "System",
"start": "2022-01-20T13:19:41+00:00",
"finish": "2022-01-20T13:19:41+00:00",
"comment": "Comment on Test",
"status": "PASS",
"steps": [{
"status": "PASS",
"comment": "Coment on Test Step Result ",
"start": "2022-01-20T13:19:41+00:00",
"finish": "2022-01-20T13:19:41+00:00",
"actualResult": "Log file to step\n${File3}\nLog\n<a href=\"${filepath}\"><img src=\"${filepath}\"></a>, HTML\n",
"evidences": []
},
{
"status": "PASS",
"comment": "Coment on Test Step Result ",
"start": "2022-01-20T13:19:41+00:00",
"finish": "2022-01-20T13:19:41+00:00",
"actualResult": "Log\n<img src=\"${filepath}\"</img>, HTML\n",
"evidences": []
},
{
"status": "PASS",
"comment": "Coment on Test Step Result ",
"start": "2022-01-20T13:19:41+00:00",
"finish": "2022-01-20T13:19:41+00:00",
"actualResult": "Log\n<msg src=\"${filepath}\">img src=\"${filepath}\"</msg>, HTML\n",
"evidences": []
}
],
"testKey": "AAAB-2650"
}]
}


any input/suggestion is very much appreciated.

Stefan Salzl
Community Champion
April 26, 2022

Hi @Singa Selva Sankar 

Could you provide a screenshot of your releases/versions screen?

Best
Stefan

Singa Selva Sankar
Contributor
April 26, 2022

hi @Stefan Salzl , attaching my versions page

 

image.png

Singa Selva Sankar
Contributor
April 26, 2022

not only for versions, I am getting the same kind of error message for component, test category and labels

Stefan Salzl
Community Champion
April 26, 2022

Hi @Singa Selva Sankar 

According to this documentation of the Xray-JSON format there is a limitation of fields that can be set via Xray-API. 

My personal assumption is that other fields would need to be set via Jira-API.

 

Best
Stefan

Singa Selva Sankar
Contributor
April 26, 2022

Hi @Stefan Salzl thank you for your input. I will check if I could update via Jira-API

Like Stefan Salzl likes this
Singa Selva Sankar
Contributor
April 28, 2022

Hi @Stefan Salzl I created test execution separately and was able to able to update it separately using Jira API. Thanks, this helps. 

Like Stefan Salzl likes this
Stefan Salzl
Community Champion
April 28, 2022

AWESOME!!!! great effort 🙌👌

Happy to know you got it working ;)

Like Singa Selva Sankar likes this
Syed Kaleem Syed Khaleel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 31, 2024

Hi @Singa Selva Sankar , can you pls provide URL and payload to only create test execution cycle using API. Am able to update an existing Test execution cycle using JSON result format through XRay API. But struggling to create a new test execution cycle  using JIRA api. 

Suggest an answer

Log in or Sign up to answer