Can I configure user / group who can view a custom field?

Ilka September 24, 2013

Hi All,

I have few questions about JIRA related to custom field.

1. I want to configure who can view a custom field.

Practically, i need a custom field that visible for internal users and hidden for external users.

Is it possible to do that? And how if that is possible?

2. Is there any permissions setting for issue navigator and export tools?

Related to point 1, i don't want any hidden field can be viewed by external users on issue navigator / export tools.

I really appreciate your helpful answer :)

6 answers

1 accepted

0 votes
Answer accepted
RambanamP
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.
September 24, 2013

field level secirity is not possible in jira as of now, check this

https://jira.atlassian.com/browse/JRA-1330

some third party plugin is there, you can try with this

https://marketplace.atlassian.com/plugins/com.quisapps.jira.jfs

or you can implement this by using javascript

Ilka September 29, 2013

Thx. But what do you mean i can implement this by using javascript, could you explain me in detail?

RambanamP
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.
September 29, 2013

check my another answer, i gave javascript to hide field for specific group

0 votes
RambanamP
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.
September 29, 2013

try with this javascript

<script type="text/javascript">  
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
hideField();    
});
hideField();
function hideField(){
        var user=getCurrentUserName();			
		if(isUserInGroup(user,'Developers')){
			//to hide the Activity Tab
			$("#customfield_10571").closest('div.field-group').hide();
		}else {
			AJS.$("#customfield_10571").closest('div.field-group').show();
		}

}
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>

Ilka September 29, 2013

Wow.. thanks a lot!

Sorry i'm a newbie for this thing, then where should i put this script?

RambanamP
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.
September 29, 2013

1. put this javascript on custom field description in field configuration

2. load it as a webresource module in plugin, check this

https://developer.atlassian.com/display/JIRADEV/Custom+Fields+that+use+CSS+or+JavaScript+Web+Resources+in+JIRA+5.0

3. add it in footer.jsp

i suggest to load javascript as webresource!!

0 votes
Sara ak
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.
September 24, 2013
0 votes
Bharadwaj Jannu
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.
September 24, 2013

1# you check this link and see Nic's comment.

2# you can set the permissions to users/roles/groups on PermissionScheme->Browse Project

Ilka September 29, 2013

Thanks. But for 2# i mean i want to limit groups who can export & configure column on issue navigator, not limitation for browsing project. Any solution for this one?

0 votes
Ilka September 24, 2013

Please help me

0 votes
Ilka September 24, 2013

Please help me.. thanks

Suggest an answer

Log in or Sign up to answer