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

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

This widget could not be displayed.
Alexey Matveev Community Champion Nov 01, 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

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 Community Champion Nov 01, 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 Community Champion Nov 01, 2017

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

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
Community showcase
Posted 12 hours ago in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

35 views 1 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you