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

This widget could not be displayed.

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?

This widget could not be displayed.

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
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

40 views 0 1
Join discussion

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