Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,612
Community Members
 
Community Events
184
Community Groups

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

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

0 votes
José Domingues [Xray]
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 14, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events