Hello everybody. I try to make Script Listener, which in the time of issue creation make a Issue in another instance of jira via REST and I want to parse response to get ID of created issue and set that ID in to custom field, but I can't. Is it possible to set value in custom field via script listener when Issue Create event happens?
def issue = event.getIssue()
def key = issue.key
MutableIssue mI = ComponentAccessor.getIssueManager().getIssueByCurrentKey(key)
mI.setCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Issue ID"),"here is ID from response")
And why I can't use this
def issue = event.getIssue()
issue.setCustomFieldValue(cF, value)