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?
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. It's meant as a special override only available to certain users. I feel like it will create a messy workflow diagram if I add this transition from every existing status and then add a condition to it in the transition settings.
Yes, I understood what you want to do. But I think to create such a transition and put a condition on this transition would be a more supportable solution and definitely easier to implement. I am not sure about your requirements, but there is a generic transition from any status to a status. Maybe it will make your life easier to configure what you need.
It's not possible. There is no "edit status", you MUST have a transition to take an issue from one status to another.
To implement a new button that uses ScriptRunner to do this, you are still going to have to have a transition there.
Your description feels like you are massively over-engineering this. A normal transition with a simple "only certain users" condition on it meets your need immediately.
I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event