Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Transition issue upon custom button click Edited

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?

1 answer

1 accepted

1 vote
Answer accepted

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. 

Like James Salao likes this

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.

Yeah, I ended up doing that. The transition conditions that are built in, including the scripted ones, are sufficient for my requirements. Thanks!

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

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 ...

3,957 views 11 5
Join discussion

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you