Hi Folks,
I need to copy the value from a custom field in Jira to Fix Version field in a workflow postfunction in Jira via Script Runner plugin.
Need help with the groovy script to do the same.
Thanks and Regards,
Jenin C M
Something like this:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.version.Version
import com.atlassian.jira.event.type.EventDispatchOption
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def csVersionPicker = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("version_picker")
log.error(issue.getCustomFieldValue(csVersionPicker))
List<Version> versionList = (List<Version>) issue.getCustomFieldValue(csVersionPicker)
issue.setFixVersions(versionList)
ComponentAccessor.getIssueManager().updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED, false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.