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

Thanks

Naama

2 answers

1 accepted

0 vote

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:

https://confluence.atlassian.com/display/JIRA/Configuring+Issue-level+Security

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 expertise.smile

 

0 vote

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?

Thanks

Naama

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Amir Kazemi
Posted 5 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

22 views 0 4
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