"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.

2 answers

1 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 vote

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

279 views 3 11
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you