Forums

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

Updating TestExecution Status using REST API

UI91
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!
March 11, 2022

Hi,

I have managed to create a TestExecution in JIRA using the REST API but I'm struggling to update the status of it - all material I have found online points to updating the status of the Tests within this TestExecution - not the TestExecution itself 

I have been able to update the execution status of the Test runs within the TestExection itself. My TestExecution is currently "In progress" and the status code for "Passed" is 1

So far I have tried:

 

rest/api/2/issue/{TestExecID} - { "status" : "1"}

 

rest/api/2/issue/{TestExecID}/transitions - { "transition":   { "Id" : "1" } }

 

rest/raven/1.0/import/execution - {"testExecutionKey" : "{TestExecID}", "info" : {  "status" : { "id" : "1" } } }

 

None of these have been successful so far - resulted in 405 Method not allowed, 500 Internal Server Error 

 

Can anyone help? Apologies if I'm missing out obvious info, first time poster! 

 

Thanks in advance

2 answers

0 votes
Arshin Shaikh
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 10, 2024

Hi @UI91 

How did you update the test execution result? :)

Stefan Salzl
Community Champion
July 29, 2024

@Arshin Shaikh 

did you try my approach?

Best
Stefan

0 votes
Stefan Salzl
Community Champion
March 13, 2022

Hi @UI91 

Welcome to the community ;)

I tested this and it worked well. Let´s get this working also for you. 

  • Did you re-check your transition id? When you edit the workflow the transition IDs are shown next to the specific transtions (see screenshot)

    image.png

I was able to do the transaction (for a test execution) via cURL to transition to Done (41):

curl --request POST \
  --url 'https://<your_instance>.atlassian.net/rest/api/3/issue/{issueKey}/transitions' \
  --header 'Authorization: Basic $TOKEN' \
  --header 'Accept: application/json' --header 'Content-Type: application/json' \
  --data '{"transition":
            {
              "id":"41"
            }
          }'

 

Hope this helps.

Best
Stefan

Stefan Salzl
Community Champion
March 13, 2022

@UI91 

rest/api/2/issue/{TestExecID}/transitions - { "transition":   { "Id" : "1" } }

This looks very similar to my approach. Maybe the {...} encapsulated in single quotes.

Best
Stefan

Stefan Salzl
Community Champion
March 17, 2022

Hi @UI91 ,

could you try this approach?

Best
Stefan

Suggest an answer

Log in or Sign up to answer