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 votes

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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,798 views 18 22
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