I have created the automation rule in X-ray for sending the mail whenever the test execution status shifts from To Do to Done. Now I want to show in the mail body the total number of passed and failed test cases which are present in the test execution. How to do that?
Hi @Dhiraj Kumar Sinha -- Welcome to the Atlassian Community!
Is this a question about automation in Xray or in Jira's built-in automation rules?
Kind regards,Bill
Hi Bill, I am not sure about that. I am sending you the screenshots of the automation page. Can you please let me know whether this automation belongs to Xray or JIRA?
Thanks for those images; this appears to be a Jira automation rule.
When you want a count of issues meeting some criteria in a rule, I recommend using the Lookup Issues action with JQL on the conditions: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues
For the matching issues, the count would be the size of the list of issues:
{{lookupIssues.size|0}}
Hmmm let me try & i ll get back to you on this.
Please check this tutorial on the Xray documentation which showcases how to achieve something very similar but for Test Plan issues.
The whole idea is about using GraphQL requests to get the information you need and then save it on variables that you use to fill the body of the email.
To perform the count, you need to process it on automation side as those counts don't come on the GraphQL body .
You may need to use this getTestRuns Graphql function.
It looks like you're new here. Sign in or register to get started.