How to dynamically determine parent status from child pages
Asked by David Cuozzo:

I am managing multiple products for a business unit with multiple solutions. Each solution has multiple projects. Each project has multiple sprints. So this is a 3 level parent-child hierarchy where the sprint pages rollup to the project page, and the project pages rollup to the solution page. Each sprint has a status. I am using the Page Properties and Page Properties Report macros to display multiple sprint statuses on the project page.

What I want to do is to derive a single status for the project page that is based on the statuses of the child sprints. I've included an example where one of 4 sprints is in "Jeopardy". I want to derive a single status for the project page which is "Jeopardy" if any of the sprints are in jeopardy. If no sprint is in jeopardy, but a project is labeled for "Discussion", then I want the project status to be "Discussion", etc.

In the attached example, I have to set the project status manually. I want to be able to determine the project status dynamically. Are there any options that would allow me to do this?

![project summary example.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/250821iB82AC0798226A8B7/image-size/large?v=v2&px=999 "project summary example.jpg")


Answers:
author: Katerina Rudkovskaya [Stiltsoft]
body: Hi [@David Cuozzo](/t5/user/viewprofilepage/user-id/4236820),  

If you have the [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?tab=overview&hosting=datacenter&utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) app (the add-on is developed by our company) installed for your instance, you may try to play with the [Table Transformer](https://docs.stiltsoft.com/tfac/dc-server/how-to-use-table-transformer-macro-42241552.html?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) macro -- it will simplify your manual work.  

![Tue 3-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/251095i92B9928B89DE2D05/image-size/large?v=v2&px=999 "Tue 3-1.png")  

SELECT "Project A" AS 'Project Name', 'Status'  
FROM T\*  
WHERE 'Status' LIKE "%JEOPARDY%"  
GROUP BY 'Status'  

![Tue 3-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/251096i313B4C401591A542/image-size/large?v=v2&px=999 "Tue 3-2.png")  

For example, here we automatically check the table with sprints if they have "JEOPARDY" statuses.

comments: author: David Cuozzo
body: Thank you for the suggestion. Does the output of the macro need to be a table or can it be a single value? Also, we have multiple different exception statuses. How could I configure the query to resolve a condition and then return the desired status as specified in my original question: " I want to derive a single status for the project page which is "Jeopardy" if any of the sprints are in jeopardy. If no sprint is in jeopardy, but a project is labeled for "Discussion", then I want the project status to be "Discussion", etc.". Thank you.


author: Stiltsoft support
body: In general the output of the macro is a table but if you change the query as

SELECT 'Status'  
FROM T\*  
WHERE 'Status' LIKE "%JEOPARDY%"  
GROUP BY 'Status'

and go to the ***Options*** tab and choose to ***show the result as plain text***, you will be shown just status without any borders:

![Fri 3-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/251777i08D87720DC5142D3/image-size/large?v=v2&px=999 "Fri 3-1.png")

So, you may try to collect these statuses in your 2nd level table and then use another Table Transformer macro to leave the "Jeopardy" statuses as they are and override your empty cells with the new statuses based on the contents of other columns (containing labels, for example).

[Here is an example](https://docs.stiltsoft.com/tfac/cloud/advanced-table-cells-formatting-58426218.html#Advancedtablecellsformatting--Conditionalinsertingofstatuses?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) from our documentation (please navigate to the "Conditional inserting of statuses" section).

Maybe it is not an elegant solution but the case itself is rather overloaded and the standard macros won't do any good here.

If you are stuck, you may refer to our [support](https://jsd.stiltsoft.com/servicedesk/customer/portal/2): the portal is confidential, so attach the full screenshots of the tables belonging to the each level, we'll try to recreate them and help to get the most close result to the desired outcome.


Tags: confluence-server

filter

server

table

table-filter

table-filter-and-charts

table-transformer