I would like to execute a transition when a custom button is clicked. The button was created using Scriptrunner's custom web item. I know there are events, triggers, listeners, and behaviours that could be utilized, but I'm having trouble connecting the button to a piece of code.
I'm not sure if its possible, but I would like to trigger a transition between two statuses that aren't connected by a transition in the workflow.
I've seen the "Fast-track transition an issue" script listener which sounds helpful, but it needs an event to trigger it. I would need a custom event for this.
Behaviors can hook into the button key as the context id, but then I would need to have a programmatic solution for the transition.
A custom REST endpoint call can also be done from the button, but that will also require a programmatic transition. There's also the issue with getting the user who made the call. ComponentAccessor.getOSGiComponentInstanceOfType(UserManager).getRemoteUser() doesn't appear to exist anymore.
There are also trigger options in the workflow transition itself, but they seem limited to code review and version control triggers.
What method would you recommend for my requirements?