Script to hide Assign button in Jira 6.0.1 is not working.

Test User July 4, 2013

In my workflow I have my own transition to Assign state that prompts for Assignee and additonal information. I'd like to remove or hide the default "Assign" button to avoid user confusion. (Note: I don't want to remove Assign permission because they still need to set the Assignee in the screen I've created for the transition.)

Based on previous suggestions, I've tried putting the following script into the banner message, but for me it has no effect:

<script type='text/javascript'>
AJS.$(document).ready(function() {
var btnAssign = AJS.$("#assign-issue");
btnAssign.parent().remove();
});
</script>

When I view the page source I can see that my script is there ok. I'm not familiar with javascript, so I'm not sure if I've missed something obvious.

I've tried this in Chrome & FireFox with the same result - (and yes, Javascript is enabled).

(IE 10 messes up the UI pretty badly in general so I can't really test with it).

Any advice greatly appreciated.

5 answers

1 accepted

1 vote
Answer accepted
Norman Abramovitz
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.
July 4, 2013

Please see the previous answer to this question.

https://answers.atlassian.com/questions/19565/can-we-hide-the-assign-button

0 votes
Özerk Dolanbay January 9, 2014

Raj

This code works with jira 5.2 but after upgrading jira to 6.1.5 then it doesn't work now. Maybe it helps you

&lt;script type='text/javascript'&gt;
function contentChanged(){
   var btnAssignToMe = AJS.$("#assign-to-me");
   var btnAssign = AJS.$("#assign-issue");
   
   btnAssignToMe.parent().remove();
   btnAssign.parent().remove();
}
AJS.$(document).ready(function() {
        var workflowState = AJS.$('#status-val img').attr('alt');
        var issueType = AJS.$('#type-val img').attr('alt');
        var projectName = AJS.$('#heading-avatar img').attr('alt');
        if(projectName == 'your project name') //you may add a status control 
        {
           contentChanged();
           var myElement = document.getElementById('stalker');
           if(myElement != null &amp;&amp; window.addEventListener){
             // Normal Browsers
             myElement.addEventListener('DOMSubtreeModified', contentChanged, false);
           } else
             if(myElement != null &amp;&amp; window.attachEvent){
               // IE
               myElement.attachEvent('DOMSubtreeModified', contentChanged);
           }
        }
});
&lt;/script&gt;

0 votes
Raju Adluru
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.
August 27, 2013

Philip

It hides the Assign button in 6.0.2, but when i go to another transition in workflow, it appears again, when i refresh the page, it goes away!!! how to hide it permanently? Thanks.

0 votes
Test User July 4, 2013

Sorry - I should have been clearer. I'm trying to hide the "Assign" button that appears on the ops bar whenever you have assign permission.

0 votes
Colin Goudie
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.
July 4, 2013
Not sure if I totally understand where you're trying to remove it but if it's the Assignee field in a transition screen you could try changing the #assign-issue to #assignee-field
Colin Goudie
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.
July 4, 2013
Actually, maybe change to #assignee-container and drop the line about the parent()

Suggest an answer

Log in or Sign up to answer