Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Structure: calculated parent field (Health) based on it's children

Aquarius
Contributor
June 16, 2025

Hi all, 

I am using Structure containing "root sagas" and "child sagas" that are linked to root sagas with "implements" link.

I use calculated field determining health status based on logic of dates fileds: duedate, targetend date, etc. works fine for single records.

How can I add the same logic for "root saga" health to be calculated based on the healthiness of it's children? e.g. if one of the children is delayed - root saga is health = delayed?

Does anyone have example code?

1 answer

Suggest an answer

Log in or Sign up to answer
1 vote
Stepan Kholodov _Tempo_
Community Champion
June 16, 2025

Hello @Aquarius 

You can use a formula like this:

if duedate < issuelinks.filter($.type = "implements").map(if $.source = this: $.destination.duedate else $.source.duedate).max(): "delayed"

The formula will extract all Due dates of issues that are linked with the 'Implements' type link, compare the latest date with the issue's own Due date, and the own date is earlier - the formula will return a text indicator.

Alternatively, you can add all linked issues to the structure using an Extend generator, and use the max{} aggregate function in the Formula instead.

I hope this helps. If you need further assistance here or if you have other questions about Structure, please reach out to us directly at our support portal.

Best regards,
Stepan
Tempo (the Structure app vendor)

Aquarius
Contributor
June 16, 2025

Thank you @Stepan Kholodov _Tempo_ , 

This already helps... step forward.. however I am a bit unsure how to proceed.
Maybe you can suggest...

The logic of the Health value that I am currently having is the following:

WITH renderStatus(bgColor, iconId, status, padding) =
"""{panel:borderColor=white|bgColor=#$bgColor}!https://d1.almworks.com/.files/weath_$iconId.png|width=15,height=15!!https://d1.almworks.com/.files/Spacer.gif|height=5|width=$padding!{color:white}*$status*{color}!https://d1.almworks.com/.files/Spacer.gif|width=$padding!{panel}""" :

if status = "resolved" OR status = "closed": // done?
renderStatus("59B161", "icn-01", "achieved", 7)


else if TargetEnd > Due: // running late TargetEnd
renderStatus("EF4B59", "icn-03", "delayed", 7)

else if
Due <= now(): // running late Past Due
renderStatus("EF4B59", "icn-03", "delayed", 7)

else if
TargetEnd <= Due: // open and still within due date
renderStatus("FFAF00", "icn-02", "on track", 7)

else if Due = undefined OR TargetEnd = undefined: // missing date and open
renderStatus("AAAF99", "icn-03", "no date", 7)

else: // done
renderStatus("59B161", "icn-01", "achieved", 7)


Now I need to apply same logic at the "root saga" level (e.g if one subsaga is delayed => root saga is also delayed).

Honestly, I can't imagine that code...

BTW, Extend Generation will probably cause performance issues (as I am having 4-5 thousands of records)?

Thanks in advance, 
Aquarius.

 

TAGS
AUG Leaders

Atlassian Community Events