"Local Help" button: how can disable it or limitate to a group/role?

Stefano De Gaetano
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.
April 23, 2015

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.

3 answers

1 accepted

0 votes
Answer accepted
Stefano De Gaetano
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.
June 29, 2015

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>

0 votes
Laura Schell December 23, 2019

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

0 votes
Arthur Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 24, 2015

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 

Stefano De Gaetano
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.
April 26, 2015

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>

Stefano De Gaetano
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.
April 26, 2015

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>

G June 13, 2016

@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

Suggest an answer

Log in or Sign up to answer