Hello,
We have a need for a script that calculates all Story Points for any project/issue/linked/sub-task under it.
So if we have an issue with lots of other issues linked to it in any way, the need is to calculate ALL the Story Points for all those tickets and any sub-task or other linked issues under there and so on...basically a top down total count.
Looking so far only gets me small snips of either getting per story or per issue type or per link. Hoping some of you can help get me a grab all values?
Thanks again in advance.
(below is what I have now that will only get items from the same issue, not to mention line 7 and 10 are throwing an error in the ScriptRunner's Scripted Field code validator)
import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def StoryPoints = customFieldManager.getCustomFieldObjectByName("Story Points")
def totalSP = 0
totalSP += issue.getCustomFieldValue(StoryPoints)?:0
issueLinkManager.getOutwardLinks(issue.id)?.each {issueLink ->
def linkedIssue = issueLink.getDestinationObject()
totalSP += linkedIssue.getCustomFieldValue(StoryPoints)?:0
}
return totalSP