Is there a field (or can I create one) that returns a list of stories in an epic?

Esther Strom November 1, 2017

If you create a filter that displays stories, you can add a column to the filter that displays a field called Sub-Tasks. Here's a sample:

filterView.png

Is there a similar field that would display a list of stories in an epic? I know I can set my jql to pull in all stories as line items, but I have a few users who just want to see the epics as line items, with a single column for each displaying a comma-delimited list of the stories in each epic.

If that doesn't already exist, is there a way to create a computed field that would provide this functionality? 

1 answer

1 accepted

0 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2017

You can use Adaptivist ScriptRunner plugin to create a scripted field with the required functionality. There are other plugins also available which allow you to create scripted fields

Esther Strom November 1, 2017

OK, I'm surprised there isn't native functionality for this, but I created a custom scripted field. I was able to get the list of issue keys by using the code in the accepted answer here, but it's just a text field. Is there any way to make the results links, as in the Sub-Tasks field shown in my OP?

Here's the code from the linked answer:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.fugue.Option

if(issue.issueType.name=="Epic") {
    def epic = (Option)Option.option(issue)
    def epicLinkManagerImpl = getBean("epicLinkManagerImpl");
    issuesInEpic = epicLinkManagerImpl.getIssuesInEpic(issue)
    return issuesInEpic.toString()

}

return null

//Method to get the greenhopper bean instance
def getBean(String beanId)
{
    def ghPlugin         = ComponentAccessor.getPluginAccessor().getEnabledPlugin("com.pyxis.greenhopper.jira")
    def descriptor           = ghPlugin.getModuleDescriptor("greenhopper-launcher")
    def applicationContext     = descriptor.getModule().greenHopperCacheManager.applicationContext
    def beanInstance      = applicationContext.getBean(beanId)
    return beanInstance;
}
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2017

Use HTML Template and return a string as html. You can read more here:

https://scriptrunner.adaptavist.com/latest/jira/scripted-fields.html#_getting_started

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2017

By the way, you did a great job. You wrote the script very fast.

Esther Strom November 1, 2017

I can't take credit for the script; I stole it from the post I linked to in my previous post. :)

Suggest an answer

Log in or Sign up to answer