Can I limit permission based on labels?

Hi Experts, 

Can I limit permission based on labels?

i.e only issues with the label 'bu' can be seen by the group



2 answers

1 accepted

0 votes
Accepted answer

Native JIRA can't do this. However, you can do this, but it will require some scripting ability, and at least one plugin. Set Issue Security in the Permission Scheme sets who can see what issues. From this documentation:

Issue Level Security can be set based on the value in a Group Custom Field. The trick here is getting the right group names in this Group Custom Field, based on the value in the label field.

  1. You will need a Workflow and/or Scripting plugin. I tested with JIRA Misc. Workflow Extensions, but there may be others. Basically, you need a Workflow or Scripting plugin that adds the ability to set a value in a Custom Field based on the value of another field during a Workflow Post Function. Script Runner can also possibly do this, but as I said, you will need to do some scripting to accomplish this task.
  2. You will need to create a Group Custom Field reserved (and hidden) specifically to contain the group data for groups you want to access the particular issues.
  3. You will need to setup your Workflow Post Function in the Initial transition when the issue is created. This Post Function should have an option (after you have installed the Workflow Plugin) for setting a field value based on a groovy script (or some similar language). This is when you choose your new custom field, and you write your script. Your script's logic should be something along the lines of if statements that set the custom field based on the value of the labels field.
  4. Once the scripting is done, test your scripting to be sure that the new Group Custom Field is being set with the value you desire.
  5. If the groups are being set in Group Custom Field correctly, you will then need to go to the Permission Scheme, and Edit it. Click "Add" on Set Issue Security, and choose the Group Custom Field Value radio button, and choose your Group Custom Field from the pulldown. Doing this limits who can see issues to only those who are listed in that Group Custom Field for that Issue. The document that I linked to above explains how to do this.

I hope I've outlined the steps here sufficiently, but what you are asking for is indeed possible. It just requires some additional plugins and some scripting


0 votes

No, the permissions and security schemes are entwined with user settings, not fields.

The closest you can get is to make use of a group-picker field.

Hi Nic, 

Can you please elaborate what is group picker field?



Yep. In Jira, a "group" is what it sounds like - it is a collection of users that you define. It gets a bit complicated trying to explain it for all situations because groups are defined in whatever system you are using for user directories, and there are several possibilities for those, which I don't really need to go into here. Let's say you have some groups: jira-users (everyone who can log in) jira-admins (your administrators are in here) team-support (people who will pick up support requests) team-java (java developers) team-fred (some people called Fred) If you add a "group picker" custom field, you will find it automatically picks up those five groups and lets you associate them with the current issue (when you create/edit it) I usually use it for "group emails" myself - in the notification schemes, it can be really useful to say "send update emails to everyone in team-java for this issue", but you can use it in the security schemes as well to say "and let the group named in this field see the issue as well"

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,730 views 17 21
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