Hello, I'm setting up an e2e test automation system on jira with the Xray plugin.
In short, when I perform my tests in my CI environment, I communicate the test results to jira via the Xray api, which generates a test execution.
I would like to know if it is possible to automatically generate a ticket bug in jira when one of the tests fails?
If you are using a CI tool, you can make a script using REST API calls to create the Bug issue and link it to the Test Execution.
Use the Jira REST API to create the bug and use Xray REST API (add defect to Test Run).
If you need further help, please contact the Xray Support (http://xraysupport.xpand-it.com) so that we can request additional information and investigate further.
Kind regards,
Rogério Paiva [Xray Support Team]
Hi @Dalil Chablis -- Welcome to the Atlassian Community!
I do not use that add-on tool, and I wonder if it can generate an incoming webhook to Jira. If so, you could use that webhook trigger to fire an automation rule to create the defect:
Best regards,
Bill
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.
Hi @Dalil Chablis,
@Bill Sheboy is right in that Web hooks are a great way to tackle this. When you said "communicate the test results to jira via the Xray api, which generates a test execution" how does this work out? Is the test execution an issue of some particular type or what happens?
Cheers,
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Simmo
I perform my e2e tests using the cypress framework.
When I run the tests, I generate a json report that I send to jira through the Xray api.
And this generates an xray run-time ticket that contains my test results.
Cheers,
Dalil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dalil Chablis,
So, if the xray run-time ticket contains the test results in the description or a custom field you could try using the Advanced compare to see if they contain key words that a indicate a test has failed and, if so, create a bug ticket.
If not, webhooks would be the way to go.
Cheers,
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please help me for sending reports to X-ray using API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ritik Banga,
If you are interested, I had made a documentation on how I set up my end-to-end test automation system.
However, this one is in French, so you will have to translate it (https://gitlab.com/dalil01/automatisation-test-e2e).
Feel free to consult it (https://docs.getxray.app/display/XRAY/REST+API).
If you have any questions, don't hesitate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Dalil Chablis
Also one more thing have you figured out how to log defect automatically because I am struggling with the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One solution I found is to go through my json report in my code, get the bugs, then use the Jira api to create issues (https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-create-issue-7897248/). @Ritik Banga
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.