Knowledge Base Articles
Breadcrumbs

How to check the Test Repository Path in a Structure formula?

This article is for Data Center.

Problem

I’m trying to build a formula in Structure that counts issues of type Test based on several conditions.
One of the conditions needs to check whether the Test Repository Path contains a specific value (for example: "customer/customer committees").

I tried using a formula like this:

sum{
 if issuetype = "Test" and Test_Category = "reception" and Customers_Label != "to brief" 
and CONTAINS(testRepositoryPath, "customer/customer committees"): 1}

However, I’m not getting any results.

Could you please advise on how to properly use the Test Repository Path field from the Xray app within Structure formulas?

Solution

The "CONTAINS" function does not perform text matching. If the full path (field's value) differs, it won't return a match.

You can apply text matching to look for elements that match a particular pattern, for example:

testRepositoryPath.ANY($.MATCH("customer/customer committees*"))

More information is available via this link: https://help.tempo.io/structure-dc/latest/expr-function-reference#ArrayFunctions-CONTAINS