How can I change the display text of a transition button?

Neil Swonger December 5, 2014

I want to be able to transition from a "Needs Information" status back to whatever previous status the ticket was in.  I am trying to do this buy adding transitions to each possible status and then adding a condition to only show if the previous status was "In progress" or "QA" but I want the button to always say "Submit Info" regardless of the transition destination since there are going to be about 6 possible destination statuses.

I tried adding a property to the transition with jira.i18n.title and then adding 'Submit Info' as the property value but that didn't work.

 

Please help.

 

Also I have the misc workflow extensions plug in installed for JIRA Cloud/ondemand

8 answers

0 votes
Mehmet Kazgan
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 8, 2014

Sorry Neil, I missed that part. I don't think you can do that with JIRA Cloud out of the box, unfortunately.

Mehmet

0 votes
Neil Swonger December 8, 2014

Mehmet,

I am using JIRA Cloud so I cannot install that plugin unfortunately.

0 votes
Mehmet Kazgan
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 8, 2014

Neil,

Here is what you have to do (remove first the conditions from there)

  1. Install scriptrunner plugin
  2. Assuming you have In Progress, QA and etc statuses, each of them has transition/action ID's to move to each statuses. Use the fast track transition issue script for the Submit Info post function (script post function) as described here: https://jamieechlin.atlassian.net/wiki/display/GRV/Built-in%20Scripts#Built-InScripts-Fast-tracktransitionanissue
  3. In that post function script, you can use the condition as (if previous status was "open"):

 

changeHistoryManager.getChangeItemsForField(issue, "status").getAt(changeHistoryManager.getChangeItemsForField(issue, "status").size() - 2).getFromString().equals("Open")

Hope that helps,

Mehmet

0 votes
Neil Swonger December 8, 2014

I have attached a screen shot of the 5 conditions I need and what post functions i have currently. I think I set them up as you indicated.  Now I assume I need a setup one or maybe 6 post functions based on the conditions?

Thank you for your help on this!conditions.jpg

 

0 votes
Mehmet Kazgan
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 8, 2014

Yes, you will have one transition with 6 conditions/post functions - and yes, you would have the same transition text.

0 votes
Neil Swonger December 8, 2014

This doesn't seem to solve my issue of wanting one button to display with the same text.  It seems like I either need one transition with 6 conditions or post functions, or 6 transitions with one condition or post function.  It seems like I still need 6 transitions and the appropriate button will show but I want the button to say "Submit Info" regardless of which of the 6 transitions is currently available to the user.

0 votes
Mehmet Kazgan
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 5, 2014

You can do this by either one of the following:

  1. By using JIRA Suite Utilities Plugin which is free and use the post function called "Value Field" where you can allow executing a transition if the given value of a field (Status) is equal to a value or value set.
  2. By using JIRA Enhancer Plugin (commercial) by using the Previous Status Condition post function
  3. Using Script Runner post function script condition.

I guess #1 is the free and the easiest way to do it.

See the screenshots for #1.

2014-12-05 15_28_35-Add Condition To Transition - Tracking System.png

 

2014-12-05 15_29_10-Add Workflow Transition Condition - Tracking System.png

0 votes
Juan Felipe Cardona
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 5, 2014

Hello

I'm affraid it cannot be done... but let's wait for other answers to see if someone else has achieved it.

Suggest an answer

Log in or Sign up to answer