Can I limit permission based on labels?

Naama Lev
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.
February 10, 2015

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 votes
Answer accepted
kitkat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2015

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

 

Naama Lev
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.
February 11, 2015

Thanks !

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2015

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.

Naama Lev
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.
February 10, 2015

Hi Nic, 

Can you please elaborate what is group picker field?

Thanks

Naama

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2015

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