Hello All
I have to read user picker field from 1 issue and set it in other. I am getting error in step-3 and not sure if step-4 is required, if so how to do it.
Step-1: Getting other issue to read user info from current issue. In current issue other issue is picked in a issue picker
def relatedIssue = ComponentAccessor.issueManager.getIssueByCurrentKey(issuePickerFieldValue as String)
Step-2: Getting user field from other issue, if not set in current issue
def relatedCustomUserFieldValue = relatedIssue.getCustomFieldValue("My User")
Step-3: Populate issue picker in the current issue ( Error on line 3)
def myPM = getFieldByName(userFieldName[0])
def pmuser = userManager.getUserByKey(relatedCustomUserFieldValue)
setCustomFieldValue(myPM,pmuser) // Error says no matching method
Step-4: Need to update the current issue, is it required
I know ScriptRunner console equivalent code as below, is there equivalent for behavior?
ComponentAccessor.getIssueManager().updateIssue(currentUser, issue, EventDispatchOption.ISSUE_UPDATED, false)
Please let me know
Abe