Is there a way to set up multiple custom views for creating tickets for each user type?

I want to be able to have different views of the "Create Issue" window which will display some fields only when the user is in our Dev team and show some other fields if the user is an Admin?

2 answers

1 accepted

1 vote

Not really, Jira doesn't do field level security - field access is determined by the project configuration, not who is looking at the system.

Exceptions are the assignee, reporter, due date and versions fields, which are partially controlled by permissions.

Thank you, I'll have a look at alternatives for our process

you can try with JavaScript but i am not sure is it possible to add javascript on Ondemand

Note: Change the custom field id's and jira group names

<script type="text/javascript">  
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
		hideTab();
	});
function hideTab(){
        var user=getCurrentUserName();		
		if(isUserInGroup(user,'Developers') ){
			//to hide custom fields
			$("#customfield_10571").closest('div.field-group').hide();
		}else if(isUserInGroup(user,'Users')) {
		//to show custom fields 
			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>

Thanks for the help! I don't think we can with the ondemand version, this could be useful for anyone who isn't though. Thanks

just for confirmation, is it not possible to add JS on field description on field configuration?

i am not aware of OnDemand version!!

I can't see any option for it, I'm still not too familiar with the system though, only just signed up which is why we're setting up things like this

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 Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

118 views 0 5
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