Hello
Could any one help me to write a script for copying value of assignee to custom field as multi user picker.
Thanks a lot.
Hi @Ashkan Malekly ,
Please try this snippet :
import com.atlassian.jira.issue.util.DefaultIssueChangeHolderimport com.atlassian.jira.issue.ModifiedValueimport com.atlassian.jira.component.ComponentAccessordef customFieldManager = ComponentAccessor.getCustomFieldManager()int cfMultiUserId = 13200def cfMultiUser = customFieldManager.getCustomFieldObject(cfMultiUserId)def cfMultiUserValue = issue.getCustomFieldValue(cfMultiUser)cfMultiUser.updateValue(null, issue, new ModifiedValue(cfMultiUserValue, [issue.getAssignee()]), new DefaultIssueChangeHolder())
Antoine
Hi Ashkan,
you don't need any Groovy script for that. Just use the "Copy Value from Field to Field" post-function, select the source (Assignee) and destination (multi user picker) fields and use the "Add source value(s) to destination field" option.
Dear @Antoine Berry
I test the snippet. But when i use it in post function (Scripted (Groovy) operation on issue (JMWE add-on)), it dose not work but when test Groovy script it works. could you help me ?
Cheers
Sure, can you provide a screenshot of the JMWE view ? And maybe the logs ?
It looks like you're new here. Sign in or register to get started.