Hi all,
In my JIRA 6.3.15 environment, there is a way to disable the Local Help button near the fields Priority, Issue Type, Resolution, etc?
The best solution is to have the ability to configure this button in order to grant the right to see it only to a particular user, group or role....
It is possible?
Thanks in advance.
Final result: how to limitate if a user does not belong to a specifica group
<script language="JavaScript">
var user = getCurrentUserName();
if (isUserInGroup(user, 'InternalGroup')){
//do nothing
} else {
AJS.toInit(function(){
// init on load
AJS.$(".aui-iconfont-help").hide();
})
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
// init on refresh
AJS.$(".aui-iconfont-help").hide();
});
}
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/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;
}
</script>
The script is missing the function call:
<script type = "textjavascript">(function($) { AJS.toInit(function(){ // init on load AJS.$(".aui-iconfont-help").hide(); }) JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { // init on refresh AJS.$(".aui-iconfont-help").hide(); }); })(AJS.$); </script>
Once I added that, it worked for me.
-- LSchell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stefano,
I can suggest to you create a local JIRA documentation and use Confluence page restrictions to limit access for a few users or roles. Another alternative is to inject some JavaScript code on the description of the fields that you'd like to restrict local help.
-- Arthur Gonçalves
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot Arthur. I just use javascript in the announcement banner to hide "Configure fields" button. Can you help me to write the script for the local help? Something like this, but I don't know how to be disabled in this case: <script language="JavaScript"> (function($) { AJS.toInit(function(){ // init on load AJS.$("#qf-field-picker-trigger").hide(); }) JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { // init on refresh AJS.$("#qf-field-picker-trigger").hide(); }); })(AJS.$); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok i Found it!!! <script type="text/javascript"> AJS.toInit(function(){ // init on load AJS.$(".aui-iconfont-help").hide(); }) JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { // init on refresh AJS.$(".aui-iconfont-help").hide(); }); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@stefanodegaetano Does this still work on JIRA 6.3 ? I can't seem to get this working via annoucement banner or field configuration.
Also I'm wondering if we can hide this in the field configuration similar to priority help text which can be hidden via
<style>#priority + a{ visibility:hidden; }</style>
Cheers,
Gaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.