I need to force a transition when an issue is assigned (via the Assign button), but only if it was previously unassigned. Following the documentation about Fast-track transition an issue,
https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_fast_track_transition_an_issue
Then building on the example given in the Script Listeners console, I created a listener on the Issue Assigned event, on my project, using this condition:
import com.onresolve.scriptrunner.runner.util.UserMessageUtil
UserMessageUtil.info('Checking condition for fast-track...')
UserMessageUtil.info("i.type=" + issue.issueType.name)
UserMessageUtil.info("issue.new_assignee=" + issue.assignee + ", old.assignee=" + originalIssue.assignee)
// Our issue types + Assignee changed but only if previously was unassigned
def result = (issue.issueType.name in ["FRI Incident", "FRI Service Request"] && (issue.assignee != originalIssue.assignee) && (originalIssue.assignee == null))
UserMessageUtil.info("Result: '" + result + "'")
return result
However, when I open an unassigned issue (which matches the issue type condition) and assign it, the listener is triggered, but the condition always returns false because the value of originlaIssue.assignee apparently is set to the new assignee - see screenshot.
Seems like a bug in the implementation, or a bug in the example.
Anyone?
