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

Push defect from existing result


#1

We’re using the miniapi with success to populate test results in TestRail from an automated test suite. This looks to be working well, but one thing we want to take advantage of is the ability for a tester to review the results and decide that it requires a defect. At the moment it looks like the only way to push a defect is to file yet another test result manually.

Is there anyway I can look at a test result and push a defect for it? I can also see this being useful with Jr. QAs who post a result, and a more senior QA determines whether or not to file a defect.

Thanks


#2

Hello Chris,

Thanks for your posting. There is currently no way to add a defect without a) editing an existing test result or b) adding a new test result. Editing test results is not supported via the API though and is only allowed for the user who added the test result, so your only option currently would be to add a new test result. This shouldn’t be a problem though, as you could just add a new test result with the same status as before. Would this work for you?

Regards,
Tobias


#3

One of the things we’re doing with our automation is providing a log which allows a manual tester or developer to reproduce the issue, including screenshots along the way. In addition, we’re automatically submitting lots of environmental data around which server was tested, what version of code was tested, which username, customer, etc.

We’ve also customized our JIRA plug in to be able to take all of this data and automatically insert it into our custom JIRA fields so we have all of the test failure data cascading down from the test result to the defect.

Unfortunately, as you can see, without the ability to submit these reports as a defect, the integration becomes more of a blank defect creator than a true result pushing system. We’ve already implemented some more advanced customizations to get us this far. Is there anything you can recommend that might help us get this information further down the workflow?

Thanks


#4

Hello Chris,

Thanks for the additional details. Just to clarify: you have an existing test result with the complete report (environment, issue details etc.) and would like to manually push a defect for this test result via the UI, is this correct?

Regards,
Tobias


#5

Yes, that’s correct. And in this case, the report was filed by an “Automation” user. However I think it equally applies when a Sr. QA reviews a failure from a Jr. QA and wants to file a defect from it. Perhaps during this process a new “failure” is registered, but that information from the original failure could be used in filing the defect.

[quote=tgurock]Hello Chris,

Thanks for the additional details. Just to clarify: you have an existing test result with the complete report (environment, issue details etc.) and would like to manually push a defect for this test result via the UI, is this correct?

Regards,
Tobias[/quote]


#6

Hello Chris,

Thanks for the clarification. This is a bit difficult as there is currently no way to edit a test result added by another user unfortunately. I’ve discussed this here and it should be possible to implement this in the defect plugin by re-using the report details from a previous test result. This would still add a new test result but you could re-use the report details and therefore submit them to Jira. This could work as follows:

  • You add an automated test result as usual
  • When a user decides to push a defect for this test result, he would open the Add Test Result and Push dialog as usual
  • The defect plugin could detect that this is an automated test (e.g. with a checkbox custom field for the test results) and would re-use the report details of the latest test result for the dialog fields which can then be submitted to Jira
  • The user then adds the test result as usual so that the new defect ID is stored as part of the test

This would require some additional customizations to the defect plugin and also include directly querying TestRail’s database from the defect plugin, but this may be a possible solution to implement the behavior you would like to see.

Would this work for you? Please let me know in case anything is unclear or if you have any questions.

Regards,
Tobias