The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to dereference Sprint values in issue from API

Tim
Contributor
June 15, 2020

I'm using ScriptRunner to iterate through the Sprints of an issue.

 

def sprints = issue.fields['customfield_10004'] as List<Map>

if (sprints == null)
logger.info("sprints = null")
else
logger.info("sprints = ${sprints}")

def fieldValues = sprints.each {
logger.info("it = ${it}")
}

2020-06-15 17:57:27.753 INFO - sprints  = [com.atlassian.greenhopper.service.sprint.Sprint@3887136[completeDate=2020-05-21T02:38:11.056Z,endDate=2020-05-04T15:01:00.000Z,goal=,id=566,name=TSTDEV: Sprint 1,rapidViewId=214,sequence=566,startDate=2020-04-20T15:01:43.272Z,state=CLOSED], com.atlassian.greenhopper.service.sprint.Sprint@1e9b5d3[completeDate=<null>,endDate=2020-06-04T02:40:00.000Z,goal=,id=588,name=TSTDEV: Sprint 2,rapidViewId=214,sequence=588,startDate=2020-05-21T02:40:54.712Z,state=ACTIVE]]
2020-06-15 17:57:27.788 INFO - it = com.atlassian.greenhopper.service.sprint.Sprint@3887136[completeDate=2020-05-21T02:38:11.056Z,endDate=2020-05-04T15:01:00.000Z,goal=,id=566,name=TSTDEV: Sprint 1,rapidViewId=214,sequence=566,startDate=2020-04-20T15:01:43.272Z,state=CLOSED]
2020-06-15 17:57:27.789 INFO - it = com.atlassian.greenhopper.service.sprint.Sprint@1e9b5d3[completeDate=<null>,endDate=2020-06-04T02:40:00.000Z,goal=,id=588,name=TSTDEV: Sprint 2,rapidViewId=214,sequence=588,startDate=2020-05-21T02:40:54.712Z,state=ACTIVE]

 I wouldn't expect the sprint related text in front of the values.  How can I dereference the field values for each sprint?

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events