This question is in reference to Atlassian Documentation: Configuring Workflow
There's no question here - what are you looking for?
Hi Nic,
I tried to use the getStatusId() and setStatusId() functions to change the EPIC status from To Do to In Progress. But it's not working / issueInputParameters1 is blank.
import
com.atlassian.jira.component.ComponentAccessor
import
com.atlassian.jira.issue.Issue
import
com.opensymphony.workflow.InvalidInputException
def issue = issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def issueService = ComponentAccessor.getIssueService()
def epicLinkCf = customFieldManager.getCustomFieldObjectByName(
"Epic Link"
)
def epicLink = issue.getCustomFieldValue(epicLinkCf) as Issue
def issueInputParameters1 = issueService.newIssueInputParameters().getStatusId()
log.debug (issueInputParameters1)
if (issueInputParameters1 == 'To Do') {
log.debug ('EPIC Status in in To Do state')
def issueInputParameters2 = issueService.newIssueInputParameters().setStatusId('In Progress')
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
issueInputParameters1 is blank ...
log.debug (issueInputParameters1)
2016-08-17 11:42:10,604 DEBUG [workflow.ScriptWorkflowFunction]:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do not try to set a status directly.
You need to move the issue through the workflow to get it to the right status. The only time setStatusId can be used is by the workflow transitions and by an issue import creating issues.
See https://developer.atlassian.com/jiradev/jira-platform/guides/issues/guide-performing-issue-operations for how to change status properly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.