Roll up local value to parent group-by in Jira structure
Asked by marc_olivier:

I have a Jira structure to help us identify those that needs leadership review.

It looks like this:  
![Screenshot 2024-06-25 154239.png](https://community.atlassian.com/t5/image/serverpage/image-id/331658i06FD9E1189E35BAF/image-size/large?v=v2&px=999 "Screenshot 2024-06-25 154239.png")  

A bunch of Jira items, grouped by "functional team".  
I calculate a custom field, "Needs review," which looks at other fields from each Jira item (see query below) and flags them with a "Needs review" or "No review needed" with some markup (I am using Jira structure on DC).  

I want to be able to add a flag at the group-by level to highlight whether any item underneath requires a review, e.g. I would like to show that we need to expand each Functional Area - Functional Team.  

I tried the following formula but was unsuccessful.

```
IF depth == 2: 
   IF AND( 
      OR(
         DAYS_BETWEEN(updated,today())<7, 
         DAYS_BETWEEN(created,today())<7
      ), OR(
         risk_level == "Moderate", 
         risk_level == "High", 
         risk_level == undefined
      ), OR(
         estimated_impact == "1 - Severe", 
         estimated_impact == "2 - High", 
         estimated_impact == "3 - Moderate", 
         estimated_impact = undefined
      ) 
   ): 
      """{panel:borderSytle=solid|borderColor=white|bgColor=#EF4B59} (*y) {color:white}Needs review{color}{panel}""" 
   ELSE: 
      "{panel:borderSytle=solid|borderColor=white|bgColor=#eeffee}No review needed{panel}" 
ELSE: 
   MAX#children{needs_review}
```

From other help threads, I know it is possible to aggregate values to a parent from children/leaves. Is it possible to do the same to show a value at a group-by-level?

Thank you!


Answers:
author: Stepan Kholodov _Tempo_
body: Hello [@marc_olivier](/t5/user/viewprofilepage/user-id/859095)   

You can use a formula like this:  

*with needs_review =*   
*IF AND(*

*OR(*

*DAYS_BETWEEN(updated,today())\<7,*

*DAYS_BETWEEN(created,today())\<7*

*), OR(*

*risk_level == "Moderate",*

*risk_level == "High",*

*risk_level == undefined*

*), OR(*

*estimated_impact == "1 - Severe",*

*estimated_impact == "2 - High",*

*estimated_impact == "3 - Moderate",*

*estimated_impact = undefined*

*)*

*): "Needs review":*

*if issuetype and needs_review: """{panel:borderSytle=solid\|borderColor=white\|bgColor=#EF4B59} (\*y) {color:white}Needs review{color}{panel}""" else*

*if issuetype and !needs_review: "{panel:borderSytle=solid\|borderColor=white\|bgColor=#eeffee}No review needed{panel}" else*

*if !issuetype and count#children{IF AND(*

*OR(*

*DAYS_BETWEEN(updated,today())\<7,*

*DAYS_BETWEEN(created,today())\<7*

*), OR(*

*risk_level == "Moderate",*

*risk_level == "High",*

*risk_level == undefined*

*), OR(*

*estimated_impact == "1 - Severe",*

*estimated_impact == "2 - High",*

*estimated_impact == "3 - Moderate",*

*estimated_impact = undefined*

*)*

*): "Needs review"}\>0: "(flag)"*   

It will return 'Needs review' for all issues that match the condition, 'No review needed' for all other issues and it'll show the red flag emoji for each group that has at least one issues that needs review in it.  

I hope this helps. If you need further assistance or if you have other questions about Structure, please reach out to us directly at our [support portal](https://tempo-io.atlassian.net/servicedesk/customer/portal/6/group/1051).  

Best regards,  
Stepan  
Tempo (the Structure app vendor)


Tags: data-center

expr

jira-data-center

structure