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

Get field value from case at test view



for a UI script I need to read a value from a test case at the ^tests/view/

I want to display a button at the top-bar (this part is already working)
depending of a boolean value which is stored at the original case (not the test)

Any sugestions?

Thanks for help in advance.


Hello Jonathan,

Thanks for your posting. Some fields are already exposed via the UI script context but this only includes system fields currently:

You can always use TestRail’s get_case/get_test API to query additional details if needed (via JavaScript) and you can use TestRail’s session-based authentication in this case (can be enabled under Administration > Site Settings > API):

I hope this helps!



Hi Tobias,

Thanks for the answer.
I just combined some of your script to create the script I needed:

	function() {
				url: 'index.php?api/v2/get_case/' +,
				dataType: 'json',
				beforeSend: function(xhr, settings)
        xhr.setRequestHeader("Content-Type", "application/json");
    success: function(data, status, xhr)
				if(data.YOUR_FIELD > 0)
					/* Do Someting */
    error: function(xhr, status, error)



Hi Jonathan,

Thanks for sharing this here! It’s also planned to add a full JS example to our API page so it would be easier to develop custom scripts based on this.