My objective is to hide both Views and Tools drop down lists depending upon the group. These drop down list appear on the issue search page just above the search table.
I have searched in vain all around atlassian bundled jars. Does any one has a clue in which plugin these drop down list velocity templates are located ?
I have done something similar for Views dropdown .
You can write javascript to hide ..
refer below js
<script type="text/javascript"> function getCurrentUserName() { var user; AJS.$.ajax({ url: "/rest/gadget/1.0/currentUser", type: 'get', dataType: 'json', async: false, success: function(data) { user = data.username; } }); return user; } function getGroups(user) { var groups; AJS.$.ajax({ url: "/rest/api/2.0.alpha1/user?username="+user+"&expand=groups", type: 'get', dataType: 'json', async: false, success: function(data) { groups = data.groups.items; } }); return groups; } function isUserInGroup(user, group){ var groups = getGroups(user); for (i = 0; i < groups.length; i++){ if (groups[i].name == group){ return true; } } return false; } var user = getCurrentUserName(); if (!isUserInGroup(user, 'jira-administrators')){ AJS.$(function(){ AJS.$('span').each(function(){ if(AJS.$(this).html() == 'Views')// Checks if the page is issue navigator page { AJS.$(this).hide(); if(AJS.$(this).html() == 'Tools')//Checks if the page is issue navigator page { AJS.$(this).hide(); }); } }); } }); }); } </script>
familiar code ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes its from your tutorial AJS tricks :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you also precise me where I could add the same condition restricting group level visibility on tools and views drop down list located on dashboard and issue page?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you want to hide these dropdowns where ever they appear in JIRA ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes! The two buttons should be hidded in all the JIRA pages
I have added your code in each of the jsp's containing these buttons though respective div id's
/atlassian-jira/includes/navigator/table/header.jsp
/atlassian-jira/includes/panels/issue/viewissue-opsbar.jsp
However I havnt figured out yet the jsp containing the tools drop down list that appears on the dash board page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The above script should be applied using a web resource plugin or pasted Announcement banner.
There is no need to change JIRA code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They are not in a plugin. The specific elements come from /atlassian-jira/includes/navigator/table/header.jsp file. If you are conditions, it will mostly go here!
Thew views themselves come from search request views. See /atlassian-jira/WEB-INF/classes/system-issueviews-plugin.xml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.