Can we enable jira fields based role?

srinivasp
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 13, 2013

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

2 answers

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 16, 2013

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>

0 votes
Jobin Kuruvilla [Adaptavist]
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 13, 2013

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

srinivasp
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 16, 2013

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

Suggest an answer

Log in or Sign up to answer