JIRA: Need count of stories under an epic

Jyotirmay December 13, 2018

We need to make a dashboard displaying below two values

 

 

Epic Name            No of stories created under Epic   

 

Please help us to count the stories. We are not able to find any plugin so far so may be script needs to be written. Please help!

3 answers

0 votes
Raimundas Juska
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.
December 13, 2018

Hi,

You can also try this app - https://marketplace.atlassian.com/apps/1219429/status-progress-report-gadget-for-jira

You would need to enter JQL such as - "Epic Link" = "name of your epic" and type = story

Mayur Ingale May 6, 2019

Thanks, Raimundas... and appreciate your efforts on the creation of such a good plugin.

But 'Status & Progress Report Gadget for Jira' is only available for Cloud version not for Self-hosted server version.

0 votes
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.
December 13, 2018

Hello,

You would need an add-on for it.

You could also use the Power Custom Fields Premium add-on:

https://marketplace.atlassian.com/apps/1210749/power-custom-fields-premium?hosting=server&tab=overview

You could create a SIL custom field with a script like this:

return size(allLinkedIssues(key, "Epic-Story Link"));

0 votes
Marc Minten _EVS_
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.
December 13, 2018

If you have scriptrunner, just create a Scripted Field.

The script should look like

IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager()

Integer stories = 0
issueLinkManager.getOutwardLinks(issue.getId()).each {epicLink ->
if (epicLink.getIssueLinkType().getName() == "Epic-Story Link") {
Issue epicLinkedIssue = epicLink.getDestinationObject()
String liIssueType = epicLinkedIssue.getIssueType().getName()
if (liIssueType == "Story") {
stories+=1
}
}
}
return stories.toDouble()
Mayur Ingale April 29, 2019
Issue epicLinkedIssue = epicLink.getDestinationObject()

epicLinkedIssue is not acceptable in code by Script runner Script field?

 

Any suggestion?

Marc Minten _EVS_
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.
May 6, 2019

What do you mean with "...is not acceptable..." ???

Mayur Ingale May 6, 2019

While creating a Script field using Scriptrunner... its giving red indicator.

2019-05-07 09_50_41-Script Fields.jpg

Marc Minten _EVS_
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.
May 6, 2019

Just add the line

import com.atlassian.jira.issue.Issue

at the beginning of your script ? (that's just very basic groovy knowledge …) 

Suggest an answer

Log in or Sign up to answer