Structure: How do you use formula language or JQL to return summary of an Initiative or goal?
Asked by Bernard Horowitz:

We use a hierarchical system for linking issues. At the top is a goal which feeds down to an initiative, and then down to Epics, stories, tasks etc. In a column in structure, I would like to list title (Summary) of the goal or initiative that an epic is linked to (child of). I can do the recursive search without problem but I am trying to figure out how to return the summary field of the issue as a column. Suggestions?  

Thanks  

Bernard


Answers:
author: David Niro
body: Hello [@Bernard Horowitz](/t5/user/viewprofilepage/user-id/4575858) ,

Something like this [formula](https://wiki.almworks.com/documentation/structure/latest/data-center-and-server/aggregate-function-reference-147816491.html#id-.AggregateFunctionReferencev8.0-PARENT) may work for you :

```
IF issuetype = "EPIC":
    PARENT#level=1{summary}
```

That should return the Goal level and to get the Initiative level, I believe you would want to change ***#level=1*** to ***#level=-1***.

Please let me know if this helps.

Best,  
David

comments: author: Bernard Horowitz
body: David,  

Thanks for the response. I understand what you are doing with this but it doesn't work. The initial JQL uses a recursive lookup:  

issueFunction in linkedIssuesOfRecursiveLimited("issuekey in (xxx-xx,xxx-xx,xxx-xx,xxx-xx,xxx-xx,xxx-xx)", 4, "is parent of")and issuetype =Epic and FixVersion is EMPTY and filter=YYYYYY and status !=Done and created \<= -180d and project !=Templates  

The XXX-xx refers to Goals issue key that I want to include. I am assuming that the 4 goes down to from Goal, to a nested goal, to Initiative, to Epic.  

When I add your formula to the column it is pulling the heiarchy as rendered in the search, so If I am using a folder above the JQL in the automation it pulls that instead of the heiarchary of the actual issue Goal --\>Goal --\> Initiative --\> Epic....I want to go to either the top level goal or the second goal. But in my list as generated by the inserted JQL I don't need to see initiatives or Goals, just the column showing the linking to it. Make sense?  

<br />


author: David Niro
body: Hi [@Bernard Horowitz](/t5/user/viewprofilepage/user-id/4575858) ,

Do I understand correctly that the Goals and Initiatives are not in the structure?

If that's the case, we can get the summary from the Initiative since it is directly related to the Epic. We are not able to get the Summary from the Goal as it is two steps removed from the Epic.

The formula for the Initiative's summary would look like this:

```
issuelinks
    .FILTER($.type = "composition" AND $.destination = this
    ).source.summary
```

It filters the issue link type identifying the destination (should be the Epic) and then returns the issue(s) linked to it as defined. It then returns the Source issue's (should be Initiative) Summary.

It makes use of [Array Functions](https://wiki.almworks.com/documentation/structure/latest/data-center-and-server/expr-function-reference-152896299.html#id-.ExprFunctionReferencev8.1-FILTER) and [Item Property Reference](https://wiki.almworks.com/documentation/structure/latest/data-center-and-server/item-property-reference-130880811.html#id-.ItemPropertyReferencev7.4-IssueLink).

You will need to update "composition" to match the issue link type that connects your Epics and Initiatives. If you don't get the results you expect, it could be the destination and source pieces of the formula need to be switched.

Please let me know if this helps.

Best,  
David


Tags: confluence-server

server