Hi gurus,
I am trying to loop through all stories linked to a epic to obtain the story and sprint name that is to be done last to update the EPIC with this sprint name.
I am able to use JQL query to get the stories however I don't seem to be able to see a way to obtain the sprint name from the sprint field returned.
This is the code relevant code from the script -
final customFieldName6 = "Sprint"
def customField6 = ComponentAccessor.customFieldManager.customFieldObjects.findByName(customFieldName6)
assert customField6 : "Could not find custom field with name ${customFieldName6}"
def cfSprint = issue3.getCustomFieldValue(customField6).This is value returned in cfSprint - "[com.atlassian.greenhopper.service.sprint.Sprint@5922bda1[id=2774,rapidViewId=734,state=CLOSED,name=DC PI14 - S1 - SXBC,startDate=2023-02-13T00:00:00.000Z,endDate=2023-02-26T00:00:00.000Z,completeDate=2023-02-25T06:29:50.993Z,activatedDate=2023-02-13T06:21:02.220Z,sequence=2774,goal=,autoStartStop=false], com.atlassian.greenhopper.service.sprint.Sprint@78ea9d6d[id=2786,rapidViewId=734,state=FUTURE,name=DC PI14 - S3 - SXBC,startDate=2023-03-13T00:00:00.000Z,endDate=2023-03-26T00:00:00.000Z,completeDate=<null>,activatedDate=<null>,sequence=2786,goal=<null>,autoStartStop=false]] 2023-03-23 05:14:41,505 WARN [acme.workflows]: End
I need now to interrogate this string to obtain the last name in the string. NB - there are often multiple names in the string.
Please help suggest how I do this.
Dave