Scriptrunner Fragments & Jira 9 - Create Button next to Workflow Dropdown

Adam Laskowski November 6, 2023

Hi everyone,

in Jira 9+ all Transition-Buttons are now inside a Workflow-Dropdown. 

image.png

We don´t really mind this but in some cases/projects we really want to separate a button and put it right next to the Workflow-Dropdown or the Assign-Button.

On top of that we like to create a second button which do something else like redirect to a link. This should be possible with Scriptrunner Fragments but i wasn't able to create something like this. I kinda have now two questions regarding buttons:

1 - Is there a solution to set a transition-Button next to the transistion-dropdown? Maybe using fragments? Dont really want to buy another third-party app.

2 - Using fragments is it possible to create a "custom-web-item-Button" right next to the transition-dropdown? 

In the fragments configuration there is field "What section should this go in" with dozens of options. With the option "jira.issue.tools" i was able to create a button but it is... well next to the tools buttons in the issue view. Not exactly what i want. Anyone some ideas?

Thanks!

Cheers
Adam

3 answers

1 accepted

2 votes
Answer accepted
Robert Bailey
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.
November 6, 2023

Hi @Adam Laskowski , 

 

You can add buttons to that area by setting the location to "operations-restore". For example:

image.png

Which results in this: 

image.png

 

Does this meet your needs? 

Kind regards, 

Bobby

Adam Laskowski November 7, 2023

@Robert Bailey 

wow that`s it! 

"operations-restore" is the right option and it works like a charm.

Thanks a lot! 

Like Robert Bailey likes this
0 votes
Jonny March 22, 2024

Hi. I'm also interested in this. I managed to create the button but how do I get that button to open a screen from the transition drop-down? Thanks 

Peter-Dave Sheehan
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.
March 22, 2024

You can't just trigger a regular jira screen from a custom web item (button).

If you want the button to prompt users for input, you will need to set that web item to "Run Code and Display a Dialog".

That "run code" will have to be a custom REST enpoint that generates all the HTML for a dialog with whatever input fields you want.

Then that dialog will have to include some javascript to trigger the desired action either via another customer POST rest API endpoint or built-in rest apis.

You would basically be building your own application on top of Jira.

You can read more about this here: https://docs.adaptavist.com/sr4js/latest/features/script-fragments/custom-fragments/web-item#dialogs-advanced

0 votes
Dalibor Gasevic November 28, 2023

@Robert Bailey Thanks, that helped me also.

I have two questions related to this:

Can I add also an icon to that button?
Background information: I want actually to show customized screens for the "Edit". Therefore I would like to remove the original "Edit" Button (on the left in your screenshot) and use my own button, but also add the icon.

Second is: can I define the position of the button? Can I move it completely to the left (instead of the original "Edit"-Button) for example?

Thanks and best regards,

Dali

Robert Bailey
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.
December 6, 2023

Hi @Dalibor Gasevic , 

 

Apologies for the delayed response. I have looked into this and its not quite possible to do exactly what you need. It is possible to hide the edit button, but it is not possible to add a new button there or have the 'edit' icon available. 

The closest I could get was to the right of the 'Add comment' button. It looks like the section that contains the edit button is not available to us. 

I have attached these screenshots to show you what is possible: 

frament_edit_location.pngframent_edit_location_config.png

I hope this helps! 

Kind regards, 

Bobby

Like Dalibor Gasevic likes this
Dalibor Gasevic December 6, 2023

Thanks a lot for your help, Bobby!

Like Robert Bailey likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events