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

Required field for test results based on test result type?



Is it possible to define a field required for a specific test result type ?

My scenario is the following:

We like to have the Elapsed as mandatory field when tests have been executed - except when a test is marked as “Retest” as we like to use this as a simple marker, e.g. when a defect has been resolved.

So it does not make sense to enter a value for the Elapsed field here and a artificial value would have an impact to the prediction functionality.

So any chance this can be done ?



Hello Andreas,

Thanks for your posting! Configuring the mandatory/required attribute depending on the status is currently not available as a built-in feature but has been requested before and it’s planned to look into this. I’m happy to add another vote to this feature request. As a workaround, you can also use a UI script in the meantime if this is a critical feature:

(you would need to modify this slightly and take into account the test result status which is available as o.values.status_id)



Hi Tobias,

thanks for the answer, I will try it and see if this is working as I expect


When I copy the script and try to save it, I get

Line 8 uses an invalid format ("name: value" expected).


Hello Andreas,

You would need to add an additional newline/empty line before js:. The forum unfortunately removes this empty line. You would also need to use the second example (for TestRail 4.0 and later).

I hope this helps!



Thanks it is working


Great to hear that :slight_smile: