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?
Artemy, I think you are doing something wrong with Jira.
But answering your question, you can call Jira Rest Api from the button to make a transition.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I ended up doing that. The transition conditions that are built in, including the scripted ones, are sufficient for my requirements. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.