Access to an user for single ticket

Chenthil Kumar S August 7, 2023

I wish to make a access to the ticket based on the watchers list.

As issues security or permission schemes not having to pull the list of waters, can some one pls guide me on this. 

3 comments

Comment

Log in or Sign up to comment
Judd Garratt - Path of Trees
Atlassian Partner
August 7, 2023

Issue security can't be set by 'Watchers' and automation can't be triggered by changes to 'Watchers', but there is a way to work around this (though it's not perfect).

1. In Jira admin, under 'Custom fields', create a new multi-user custom field. I called mine 'Users who can access'.

Screenshot 2023-08-08 at 10.42.03 am.png

Make sure to associate this field with your project so it shows up on the issues you want to restrict.

2. Create an issue security scheme and then create a security level based on this custom field you just created.

Screenshot 2023-08-08 at 10.57.44 am.png

Add whatever other security levels you need and then associate this issue security scheme to your project.

3. Go to Automation under Project settings for your project. Create a new rule.

  • Select the scheduled trigger (because changes to watchers isn't an available trigger itself)
  • Set it to run every 6 minutes (the minimum time)
  • Tick the 'run JQL search' option and specify which issues you care about. If it's every issue in the project you can use something like:
    • priority in (Lowest, Low, Medium, High, Highest)
  • Make sure to untick the 'Only include issues that have changed since the last time this rule executed' box

Screenshot 2023-08-08 at 11.05.35 am.png

Next add an action.

  • Select the 'Edit issue fields' action
  • Select your user custom field (from above)
  • Type in the value:
    • {{triggerissue.watchers}}
  • Save and publish the rule and you're good to go

Screenshot 2023-08-08 at 11.07.58 am.png

 

This will copy the watchers for each issue into the user custom field every 6 minutes and set issue security based on that custom field. It's not perfect because of the 6 min delay, but it's the best that can be done with out-of-the-box Jira.

If you'd like me to clarify any steps, just drop a note. Good luck!

Judd Garratt - Path of Trees
Atlassian Partner
August 7, 2023

Removed - accidental duplicate.

Judd Garratt - Path of Trees
Atlassian Partner
August 7, 2023

Removed - accidental duplicate

TAGS
AUG Leaders

Atlassian Community Events