Transition issue upon custom button click

Artemy Matvienko
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2018

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
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2018

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.

Artemy Matvienko
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2018

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
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2018

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.

Artemy Matvienko
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2018

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

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2018

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