Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script Field for 'Earliest Scheduled Sprint' for work in Epic

Haddon Fisher August 15, 2019

As a scrummaster, I would like a custom field on my epics to tell me the earliest sprint work in that epic is scheduled for because I would like to know when this epic is currently slated to begin.

We name our sprints using the convention "[Team Name] [Program Increment].[Sprint Number]", and so theoretically I should be able to write a script that:

1) Looks at all issues in the sprint with a scheduled sprint
2) Retrieves the name of each sprint
3) Uses regex to parse the string sprint name for the program increment.sprint number
4) Returns the smallest value found.

I already have a custom field which sums the story points in stories in an epic, so I thought it would be relatively simple however whereas:

def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Story Size")
issueLink.destinationObject.getCustomFieldValue(customField)

Gets me a value I can turn into a double and sum and whatnot, the same on the sprint field:

CustomField customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10252")
issueLink.destinationObject.getCustomFieldValue(customField)

Seems to be returning a null field.

Is there a different or better mechanism I should be using to get the names of sprints for issues in an epic?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events