Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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 edited
(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
DEPLOYMENT TYPE
SERVER
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events