XRAY REST API: Create execution with all tests assosiated to Test Plan

Kamil Parzych December 6, 2019

Hi,

 

I know how to create test execution with assosiated test Plan using RestApi, but i dont know how to assign all tests from that test plan to test execution. Is there a way to do that?

It doesn't mather if this is done while creating or later.

 

Thanks

Kamil

3 answers

1 vote
Faten Ben Ameur September 25, 2020

Hi, please can you tell us how create test execution associated to a test plan with jira api rest. I made researchs on the internet but I didn't found the information.

thank you!

Sergio Freire - Xblend
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 19, 2020

Hi @Faten Ben Ameur

This will have to be made in separate requests.

First: Create the Test Execution issue, using the Rest API from Jira.
Second: To associate or remove a Test Execution from a Test Plan, you need to send a JSON with a list of the Test Execution keys; using the REST API for Test Plans.

Best Regards,

 

Sérgio. 

________

Solution Architect and Testing Advocate @Xray

Personal blog on testing, Agile, and software development: https://sergiofreire.com

Follow me on Twitter: https://twitter.com/darktelecom

Faten Ben Ameur October 19, 2020

Hi @Sergio Freire - Xblend

Thank you so much for your response.

Here, I tried another solution. I installed the plugin xray connecter for bamboo to import output.xml file and it Will automatically create a test execution and regroups all excuted test cases. 

Now the problem that I'm facing is that I'm always having error 401 unauthorized. I think I didn't have access to import data to Jira maybe ! 

 

Best regards, 

Faten

Sergio Freire - Xblend
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 20, 2020

Hi @Faten Ben Ameur ,

maybe your Jira credentials are not correct or maybe you don't have permission to create issues on the destination project.

If you need further assistance, I advise you to reach out to Xray support team so they can help you out.

Regards,

Sérgio

Like Faten BEN AMEUR likes this
José Luis Gonzalo Romera May 10, 2021

Hi Sergio.

How can I associate a Test Execution with a Test using XRay Cloud Rest API (no Server+DC)?

I can't find something similar to this call

POST /rest/raven/1.0/api/testexec/{testExecKey}/test

using Cloud Rest API

 

Thanks in advance

Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 19, 2021

Hi @José Luis Gonzalo Romera ,

In Xray Cloud it is necessary to use GraphQL (https://docs.getxray.app/display/XRAYCLOUD/GraphQL+API).

And you need to use the mutation addTestsToTestExecution:

https://xray.cloud.xpand-it.com/doc/graphql/addteststotestexecution.doc.html

If you need additional help, please contact the Xray Support (http://xraysupport.xpand-it.com ) so that we can request additional information and help further.

Kind regards,
Rogério Paiva [Xray Support Team]

minh.doan October 21, 2021

Hi @Rogério Paiva - Xray Xporter 
 
I tried to add a test set (with id: 133253) to test execution but was unsuccessful because the API could not find the test with that Id (correct, because it's a test set id).
Could you please help to confirm whether I could add a test set to test execution by it? Or if another one is available, please help to point it out.
Many thanks in advance.

Xray Image.png

Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2021

Hi @minh.doan 

This mutation is only for Test IDs, and there is no mutation for Test Sets.

In this case, you can set a list of Test IDs in the argument "testIssueIds".

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

chandlerm May 31, 2022

Hi @Rogério Paiva - Xray Xporter I have a similar issue here using XRAY cloud. I have created a Test Plan with all the tests ranked in the order which we conduct the tests manually. From the JIRA web client, I can hit "Create Test Execution" and it will create an execution with all the tests, ranked in the same order as the Test Plan. I see no way to do this through GraphQL API. 

addTestsToTestPlan requires a list of testIssueIds rather than a testPlanID. Is this a limitation of the API or an improper use case? It would seem to me there should be an api for all functionality within the web client. 

chandlerm June 1, 2022

@José Domingues [Xray] @Sergio Freire - Xblend Do you guys have any info/insight into my issue above?  

1 vote
José Domingues [Xray]
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 30, 2019

Hi Kamil, 

You can explore our support documents regarding this matter:
https://confluence.xpand-it.com/display/public/XRAY/Test+Executions+-+REST  to learn about the procedure of adding Tests to a Test  Execution - this should be used together with the Test Plan REST 
https://confluence.xpand-it.com/display/public/XRAY/Test+Plans+-+REST ; first, getting a list of the Tests from the desired Test plan and then using those Test keys to add them all to the execution. 

Hope this clarifies your question.

Best regards,

Team Xray

Kamil Parzych December 31, 2019

Hi,

I have found solution already.

 

Thanks! 

Like manuel.abascal likes this
manuel.abascal December 10, 2020

@Kamil Parzych do you mind sharing your solution? I'm trying to accomplish the same thing. Thanks in advance!

Hodaya Mishaeli July 12, 2021

I am trying also - can you share pls?

Thanks!! 

0 votes
irannapattar July 14, 2021

use  "POST /api/v1/import/execution/cucumber", it not only updates execution status on testcase level but also creates separate Execution Status ticket and links all test cases executed as part of respective execution.

Suggest an answer

Log in or Sign up to answer