I am not a PRO groovy coder, so could be that I am missing something.
I have a code:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.greenhopper.service.sprint.SprintManager
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.greenhopper.service.sprint.Sprint
SprintManager sprintManager
IssueManager cm = ComponentAccessor.getIssueManager()
MutableIssue issue = cm.getIssueObject("TDEV-4")
def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObject('customfield_10100')
def sprints = issue.getCustomFieldValue(field)
def result = true
if(sprints != null){
sprints.each{
log.warn(it.getClass())
}
}
Log shows classes in the returned List:
Now, if I add method getState() in iterator, it is not recognized.
Found the reason for this:
1) import com.atlassian.greenhopper.service.sprint.Sprint.State
2) Add in the each() statement Sprint sprint = it as Sprint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.