Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Option to automatically create JIRA issue when new test case added?


We are looking at modifying Testrail or creating a custom defect plugin to automatically create JIRA issues from Testrail cases without the need for manual intervention. I’m not 100% sure this is even technically possible, but wanted to reach out for your advice.

The basic overview is as follows:

  • An engineer raises a new test in TestRail and clicks the ‘Save Test Case’ button

  • A subsequent JIRA issue is automatically created from this new test case which includes all the info from the test and can be expanded upon by the engineer

Another scenario for this implementation would involve modifications to existing test cases:

  • An engineer sees that a test needs updating in TestRail and subsequently the underlying automation for it needs updating (which requires a new JIRA issue to be created for said automationwork).

  • Updating a field in Testrail and saving the test case automatically creates a new issue in JIRA.

Please can you let me know if you see this as possible at present?



Hi @jimexplore,

Thanks for your posting! This is possible to some extent but I would recommend implementing this outside of TestRail instead. For both use cases, you can look into using TestRail’s API and the get_cases API method:

This method has support for created_on/updated_on filters and this makes it possible to implement a recurring task or script that queries new/updated cases. The idea of the script would be to check for cases that were created/updated since the last execution of the script and then add or update JIRA cases as needed. For example, if new cases were added in TestRail you could look into adding new JIRA issues for those cases (using JIRA’s API) and then even link those issues back to TestRail’s cases (by setting the case references via update_case). The same applies to updated cases as well.

Please let me know in case you have any questions about this approach and I’m happy to provide more details if this would be an option.



This is great thank you!

We have managed to implement the first part:

Raise case in Testrail > Auto-create JIRA via JIRA API > Report JIRA key back to Testrail Case

So, that’s awesome.

So, here’s the rub with the second part
(Re: creating a JIRA from any test case where the field ‘Automation’ has been set to ‘Automation Update Needed’ within a certain time period.)

Is there any way via the Testrail API to pull back the JSON for cases only when a particular field has been updated within a certain time frame, rather than pulling back all cases which have had an update of any kind within said time frame?

My issue is that I don’t want to be creating JIRA issues for all updates to a case, I only want it to create them when the ‘Automation’ field is set to ‘Automation Update Needed’.

So, this kind of API request is what I’m looking for:
curl -H ‘Content-Type: application/json’ -u ‘user:api_key’ "$matches_some_string&automation_field_was_updated=$some_timeperiod_ago”

I hope that makes sense!


Great to hear that this helps :slight_smile:

There’s no currently no API filter support for this and I would recommend using the updated_on field/filter and then querying the affected test case(s). This is bit more work to implement as well as less efficient on the API side but would still be a good and robust implementation. I would also recommend storing JIRA issues as part of the References field so it’s easy to discover if there are already JIRA issues for the new/updated test cases but I believe you are doing this already.




How did you do that first part? I’m very curious because I was just asked the same exact question (“can we create a jira ticket from a testcase”) and almost in the same exact way ("when a case is set to “automation”).

Seems like a hook could be put in place to run a script; but I think that could only be done on a hosted version; not on the cloud version. But maybe there is some magic there I am missing.



Hey Jim,

One option is to use the get_cases API method with the updated_on filter for this. This wouldn’t include what was changed but you can use get_case for this plus an internal directory of the attribute you want to compare. If you detect a change (type changes to “automation”), you can act accordingly and add a JIRA ticket, for example.