Can we enable jira fields based role?

Need to disable fix version field for role jira-users only in few projects. Is it possible?

2 answers

0 vote

Yes, you can limit the "Resolve Issue" project permission to prevent people from setting the fix version field.

https://confluence.atlassian.com/display/JIRA/Managing+Project+Permissions

This is for Resolve Issue permission but how can this restrict users from changing the fix version field?

you can try with this using javascript something like this, here i am showing fixversion field to jira users group, you need to modify as per your requirement

<script type="text/javascript">  
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
hideTab();    
})
function hideTab(){
        var user=getCurrentUserName();		
		if(isUserInGroup(user,'jira-users') ){
			//to hide fixversion field
			$("#fixVersions-multi-select").closest('div.field-group').hide(); 
		}else {
			$("#fixVersions-multi-select").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>

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

633 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