It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

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 

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>

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>

@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

0 votes

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

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you