How to hide Workflow buttons

varun nalla September 26, 2013

Hi All,

I have two questions:

1. I wanted to hide Workflow button which containts list of transitions from issue detail page.

2. Is it possible not to show Global transitions button in issue detail page, if yes how this can be achieved.

4 answers

4 votes
MB
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.
September 26, 2013

By default, JIRA will enumerate and display all available transitions for which the current user has got permissions to execute.

You can create a Condition, whose purpose is to check the current state of the issue and to either allow or deny some transitions to be performed by the user from that state. That means it can hide/disable certain transitions from the list of available transitions on the issue screen, which will require you to write a JIRA plugin, to implement the logic that decides, for each transition, if it should be available to a user or not.

One more possibility (not recommended) is to just use either css or javascript to visually hide the "Workflow" button (which contains the list of transitions) from the the page, but you have to realize that user still can execute those transitions if he constructs the proper URL, so you shouldn't rely on it, but consider it just a quick and dirty workaround until you solve that issue properly.

Using javascript:

document.getElementById('opsbar-transitions_more').style.display = 'none'

Using css:

#opsbar-transitions_more { display: none }

varun nalla September 27, 2013

Thanks for your reply, in which JS / CSS file this code should go.

MB
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.
September 27, 2013

Open the page in your browser, right click it and choose "View Source". Then take a look at the children of the HEAD element, and find LINK elements, which specify which css files to include. Choose one of them, which you find the most convenient (copy the css file filename and search for it in your jira web dir to find the actual file).

varun nalla September 30, 2013

Hi Mladen,

When i looked at the source i am seeing javascript files with path :

<script type="text/javascript" src="/jira/s/d41d8cd98f00b204e9800998ecf8427e/en_US-90cskh-1988229788/6134/3/6.1-m4/_/download/resources/com.atlassian.jira.jira-issue-nav-plugin:viewissue/viewissue/IssueBodyView.js" >

There is no such file called IssueBodyView.js,i searched on entire computer, it seems they are getting generated on-fly.

MB
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.
September 30, 2013

There are a lot of js files in the head section, try searching for some of those. I can't tell you exactly which one, because you didn't mention your JIRA version. If you provide us with your JIRA version, I'll take a look and let you know which files you can use to insert your code.

2 votes
Ramiro Pointis
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.
September 26, 2013

Hi Varun, when an user doesn't have permission to make a transition, the button does not appear in the issue view screen. Is that what you are looking for?

Ramiro Pointis
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.
September 26, 2013
varun nalla September 26, 2013

Hi Ramiro,

I wanted to acheive this functinality for all workflows and users, not based on permissions / per transition.

As per above explanation, once i have a workflow lets say with 3 tranisitions and 1 global transistion, i do not want to show gloabl transition at all in issue detail page and also wanted to hide Workflow Transition button.

0 votes
RambanamP
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.
September 30, 2013

try with this script

&lt;script type="text/javascript"&gt;  
JIRA.ViewIssueTabs.onTabReady(function() {
		hideTab();    
});
function hideTab(){
//if you wnat to hide single transition then use this and here you need to change action id as per your instance
AJS.$("#action_id_41").hide();

//if you want to hide all transiitons under workflow more options then use this
AJS.$("#opsbar-transitions_more").hide();

}
&lt;/script&gt;

add this script in footer.jsp or load it as webresource module in plugin

varun nalla October 1, 2013

Thanks for your reply.

I have a workflow with the very first transition of T1, in this case i wanted to show Workflow button because it has only one transition, once i click on T1 issue moved to next status and it has T2,T3,T4 tranistions, in this case i wanted to hide Workflow button because i have more than 1 Transition.

If i place above code in footer.jsp, it will work only when page loads but this code will not be invoked as and when i am moving in different transitions.

Venkat Madhav May 8, 2014
AJS.$("#action_id_41").hide();
AJS.$("#action_id_41").parent().hide();

I tried both the statements to hide the transition but I can still see the transtion. Can you figure out what could be the problem.

0 votes
MichałS
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.
September 26, 2013

Hi you can use speakeasy plugin with an very easy JS code to hide the buttons.

MichałS
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.
September 26, 2013

btw. isn't it the easiest way just to remove the global transitions from the workflow?

varun nalla September 27, 2013

i wanted to use of global transitions, but i do not wanted to show them in the workflow

Suggest an answer

Log in or Sign up to answer