Jira Structure nesting IF statements

Dan Giordano September 11, 2024

I'm using the following IF statement to count the number of issues which test a given issue:

 

IF (issueLinks.FILTER($.type.inward = "tested by" AND $.destination = this) 
; CONCAT(SIZE(issueLinks.FILTER($.type.inward = "tested by" AND $.destination = this)); " Tests")
; "*No Coverage*")

 

 

I'd like it to be grammatically correct and if the SIZE is less than 2, it concatenates the word "test" rather than "tests", but I can't figure out the syntax to nest the IF statements correctly.

 

 

2 answers

0 votes
Stepan Kholodov _Tempo_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 24, 2024

Hello @Dan Giordano 

if you just need to count the number of specific links, you can use a simpler formula like this:

if issueLinks.FILTER($.type.inward = "tested by" AND $.destination = this).size() >0: "test" else "No coverage" 

I hope this helps. If you need further assistance here, please reach out to us directly at our support portal.

Best regards,
Stepan
Tempo (the Structure app vendor)

0 votes
Dan Giordano September 12, 2024
(not an answer, wanted to reply instead)

 

Dan Giordano September 12, 2024

I've fumbled into this slightly more efficient version, but still don't fully understand how the syntax works so I can distinguish when the SIZE is 1 or greater than 1

WITH testcount = SIZE(issueLinks.FILTER($.type.inward = "tested by" AND $.destination = this)):

IF issuetype = 'Test' OR itemtype = "Folder":
""
ELSE IF (issueLinks.FILTER($.type.inward = "tested by" AND $.destination = this);
CONCAT(testcount; " Tests");
("*No Coverage*"))

Suggest an answer

Log in or Sign up to answer