Hi All,
I need to keep certain workflow buttons hidden from all users permanently as these buttons(transitions) will be called by an external system using JIRA REST API.
I am having really hard time to find out a concrete way of doing this. I tried to use hide transition from user workflow condition but the condition always fails.
So in the end I had to try Jquery in Announcement banner:
It helped me to hide the buttons for initial page load but whenever there is a transition happening on ticket the hidden buttons show again. I am using below code. I am no expert in Javascript or Jquery so maybe i am missing something silly. I have the exact action ids which should be hidden always.
<script type="text/javascript">
(function($) {
$(document).ready(function() {
if($("#project-name-val").html()=="XYZ"){
$("#action_id_181").hide();
$("#action_id_71").hide();
//more such action ids which should be hidden
}
});
})(AJS.$);
</script>
I tried to use some more additional conditions below this code like when transition is 'assign in jira' then reload the page so that the ready function is executed and buttons hide again but there may be some better way of doing it.
if($("#issue-workflow-transition-submit").html()=="Assign In JIRA")
{
location.reload();
}
} if someone has any insights or suggestions please help!
Cheers,
Bhupesh