Hi ,
I want to set assignee based on user picker custom field but the issue is that it is assigning the issue to the reporter not the value on the custom field.
Please see code:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.user.ApplicationUser import com.atlassian.jira.user.util.UserManager CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager() def cField = customFieldManager.getCustomFieldObject("customfield_10601") ApplicationUser user = issue.getCustomFieldValue(cField) as ApplicationUser UserManager userManager = ComponentAccessor.getUserManager(); issue.setAssignee((user))
Thanks
Hello @Swarna Radha
Try this
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.user.ApplicationUser
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("customfield_10601")
ApplicationUser user = issue.getCustomFieldValue(cField) as ApplicationUser
issue.setAssignee(user)
ComponentAccessor.getIssueManager().updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED, false)
Hi Mark,
It is the same. It is making reporter as assignee instead the value in the custom field.
Note: when i am using the custom field on Create
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like something else changes assignee.
Is this postfunction? try to move it on last position.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is a post function. Now it is working after move it on last position ..
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You re welcome!
If this helps you, please mark answer as accepted :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.