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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Talsma_Dalan @Antonio Gil Coto @rajeswari saravanan the only way to do this is by using the xray API because the relationship you are referring to isn't actually a jira issue link relationship - it's a relationship on xray's custom objects. Jira automation can't touch those.
See this excellent article on an example of how to call the xray api via jira automation: https://community.atlassian.com/t5/Automation-articles/Navigating-Test-Execution-Workflows-A-Beginner-s-Guide-to-Jira/ba-p/2606780
For your use case, you will need to incorporate this method from the xray API in place of the one in the example article linked above: https://xray.cloud.getxray.app/doc/graphql/addteststotestplan.doc.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.