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

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

Identify whether an execution needs to be created or whether an existing one can be used

I need help with a small project i am running.

I have to see if there is a test on a certain date or not. But there should be a version for each day (e.g. November 9, 2020). That’s what I’m supposed to find out with the help of a REST call.

If it is not available, it must be created using a REST call.

Input data:

Date (e.g. November 9th, 2020)

1 answer

1 accepted

0 votes
Answer accepted

HI @Dominik Rüther ,

  1. what do you mean exactly with "see if there is a test on a certain date or not"? If it was created in that date? if it is scheduled to be run on that date? if it was modified on that date? Can you elaborate further please?
  2. "there should be a version for each day" => what do you mean with this exactly? 

 

Regards

Sérgio

HI @Sergio Freire 

1. We have tests every day, and i have to see, if there is already an execution created for a certain day or not. if not, an execution should be created.

2. Since we have tests evry day, during a week, there must also be an execution for each day.

I hope it is a bit more clear now.

 

Regards 

Dominik

@Dominik Rüther ,

perhaps you can try to search for the Test Executions. 

 

You can either use Jira's REST API and JQL for that or use Xray's GraphQL API, which in turn can also receive a JQL.

 

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

 

In the JQL you can search for those issues but the exact query will depend on you you say that the Test Execution is aimed for a given day.

 

Sérgio

@Dominik Rüther ,

perhaps you can try to search for the Test Executions. 

 

You can either use Jira's REST API and JQL for that or use Xray's GraphQL API, which in turn can also receive a JQL.

 

In the JQL you can search for those issues but the exact query will depend on you you say that the Test Execution is aimed for a given day.

 

Sérgio

Hello Sergio,

 

I found the Problem. Here is the Rest call:

/rest/raven/1.0/api/testplan/{testplankey}/testexecution

 

Thanks for your help.

 

Dominik

Gotcha, so you have a Test Plan and you wanted to find out the Test Executions of that Test Plan :)

All clear now? Do you need anything else?

Regards

Sérgio

maybe a little thing, how can I create a test and give it different attributes such as the status?

So far I have had this order, but I am not getting anywhere.

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

 

Thank you in advance

Dominik

Well, that endpoint...

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

 

... is to associate existing Tests to an existing Test Execution; it's not to create Tests. 

 

More details here: https://docs.getxray.app/display/XRAY/Test+Executions+-+REST

However, that endpoint is for Xray on-premises (i.e. Jira server/Data Center).. and you are using Xray on Jira Cloud.. or not really?

 

Anyway, if you aim to *create* Tests, you have to use Jira's REST API for that and when doing so, you can define the values for standard fields your issues have.

 

The following open-source repository can be useful as it provides concrete examples of usage of Xray's APIs (for Jira server and for Jira Cloud) and also for Jira's REST API.

https://github.com/Xray-App/xray-postman-collections

 

Hope it helps.

Regards

Sérgio

Hello Sergio,

thanks again, i figured it out.

But i have two more questions.  I want to find out, with the helf of a REST call, which test cases are in a specific test plan.

I also want to find out, how i ca make a REST cal to attach test cases to a test run.

Would be very nice if you could help me again.

Kind regards

Dominik

Hi @Dominik Rüther ,

I'm not sure if you're using Xray Cloud or Xray on jira premises? Can you please clarify?

Nevertheless, the Postman collections that I shared above provide examples for it.

Regards,

Sérgio

Hi @Sergio Freire 

Thank you, this has been very helpful. I have looked though the collection again and found some calls i need. Unfortunately, I couldn´t find the above-mentioned calls. Do you have an Idea?

I am using Xray on a lokal Server. 

Regards,

Dominik

Hi @Dominik Rüther ,

on your questions:

 

 I want to find out, with the helf of a REST call, which test cases are in a specific test plan.

I also want to find out, how i can make a REST call to attach test cases to a test run.

 

  1. getting the list of tests in a Test Plan
    1. please check https://docs.getxray.app/display/XRAY/Test+Plans+-+REST and use and HTTP GET  /rest/raven/1.0/api/testplan/{testPlanKey}/test  . This is in the Postman collection, under the "test plans" root folder.
  2. A Test Run is an intance of a Test in the context of a Test Execution. Therefore, I guess you want to add Tests to a Test Execution instead. If that's the case, then please check: https://docs.getxray.app/display/XRAY/Test+Executions+-+REST  . It's also in the Postman collection, under the "test executions" root folder.

 

Regards,

Sergio 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Automation

New to Jira Automation - goodbye Cron (sort of), hello new project created trigger, new additions to

Hey Everyone! Simeon from the Automation team here. I'm delighted to share some new features and improvements that we are shipping to Jira automation (Cloud only). Firstly, @Sam Harding&nbsp...

2,869 views 10 23
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