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.
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:
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?
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.
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
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
👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...
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