Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to create an empty test execution in jira using REST API and XRay for JIRA

I want to create an empty test execution through REST API, to which I will later import results.

2 answers

Hi Didhi,

Did you check Xray documentation on how to create tests and test executions using REST API here:

https://confluence.xpand-addons.com/display/XRAY/Tests+-+REST

https://confluence.xpand-addons.com/display/XRAY/Test+Executions+-+REST

 

Best regards,

Xpand Add-ons Team

I believe creating an empty test execution could be done by calling jira api and passing the test execution issue type

Could you at least link the Jira API documentation section where it shows how to create one?

Thanks

What was said before is still correct... You can use Jiras API to add a new test execution.

But I have to say it is not that easy. There are several custom fields that are used by Xray and that are needed to be filled. And these are not documented so far.

I found out the structure of the payload after I submitted a GET to an existing Test Execution.

curl -u "<YOUR USER>:<YOUR PW>;" -k -X GET -H "Content-Type: application/json" <YOUR SERVER>/rest/api/2/issue/<YOUR EXISTING TEST EXECUTION>

I used the output as a template. Now I was able add a new Test Execution:

curl -u "<YOUR USER>:<YOUR PW>;" -k -X POST -H "Content-Type: application/json" -d "@c:\temp\example.json" <YOUR SERVER>/rest/api/2/issue

I used this payload (exampel.json):

{
   "fields": {
      "project": {
         "id": "<YOUR PROJECT ID>"
      },
      "summary": "Test Execution summary",
      "description": "Description of the Test Execution",
      "issuetype": {
         "id": "10302"
      },
      "customfield_10627": ["<YOUR KEY TO THE LINKED TEST PLAN>"]
   }
}

 This added an empty Test Execution which is linked to a Test Plan. You have to add the Test Plan to the field "customfield_10627".

But I still don't know if the numeric value of the custom fields are stable in every Jira/Xray installation. Do anybody else know this answer?

I found the solution on my own. The numbers might be dynamic. I used this answer:

https://community.atlassian.com/t5/Jira-Core-questions/Getting-Custom-Field-Label-REST/qaq-p/47427

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

359 views 2 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you