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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


Is it possible to set up automation for XRay that adds Tests to my Test Plan?

I currently have automation set up that creates a set of Tests when a label is placed on a Test Plan. However, I have to manually add the Tests to the Test Plan once they are created. Is there a way to automatically add Tests to a Test Plan? I am seeing the field "Tests associated with a Test Plan", but so far have been unsuccessful in making that field do anything.

1 answer

0 votes
Rawan Bardini
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.
Jul 29, 2022

Hi @Talsma_Dalan ,

To answer your question, from my understanding a Test Plan in Xray is best used to aggregate together many Test Executions, to provide a "single status bar" for all the Test Run Statuses (Passed/Failed, etc).

The guidance I have seen is always to add Test Executions to a Test Plan. This can be done from the Test Plan itself, or from within the Test Execution. 

Once a Test Execution is added to the Test Plan, then all of the Tests within the Test Execution are also automatically added to the Test Plan for you.

From the Test Plan it will just have a popup message saying they were automatically added. From the Test Execution there will be a prompt asking you to confirm you want to also add the Tests to the Test Plan.

That would be my recommendation, add Test Executions to the Test Plan, rather than trying to add Tests to a Test Plan.

You can also reference the Xray User Guide online for more information on the Xray hierarchy and structure along with intended usage. Link to Cloud User Guide

You can look up the server version if that's what you have.

Hope that helps! Thanks!

Whether its adding the Tests to the Test Execution, or Adding the Test Executions to the Test Plan, I would still want to fully automate the process if possible. How within the automation would I achieve that? If I wanted the Tests to automatically attach to the Test Execution when they are created, is there an advanced field value change I can do with JSON to achieve this?

Hi @Talsma_Dalan I am looking for the very same solution to "how to add a test to a test set/test plan when a given label is set in the test". Have you got a solution? I was thinking about using the Xray API to do that but I didn't find a suitable endpoint. Maybe with the JIRA API we could have success ....

Same thing I’m looking for!! Any suggestions for that.I tried post functions as well but add test is not as expected.Please suggest

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events