How to set the Security Level of an issue based on group membership
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
There is a desire to have an issue to have a security level set based on whether the reporter of the issue belongs to a group that is in the security level.
Resolution 1
- Login as Admin to JIRA.
- Navigate to:
Project page > Administration.
- Go to
Permissions > Actions > Select Edit Permission
.- In the permissions page, find "Set Issue Security Permission" and add the same people or groups that were in your Security Level.
- Add the Security Level Field to your create and edit screens.
Now if you create issues, members with the permission would be able to select the *Private* permission to ensure that others who do not have the permission cannot view the issue and at the same time they cannot set issues to the private permission.
Resolution 2
You can automatically select a security level using an add-on. Below is one way to set this up using the popular add-on Script Runner. Please note that we do not provide technical support for this add-on so if you encounter problems you may need to contact the add-on vendor.
- Create a copy of the current workflow.
- Edit the Workflow:
- On the transition from Create to Open, click on it and select post function.
- Select Add Post Function.
- Select Script Post-Function and Press Add
- Select "Set Issue Security Level depending on Provided condition"
- Select Expand Example and Select "Reporter is a member of a particular group". Edit the name of the group in the textfield to match the name of your group.
- Select the name of the Security from the Drop Down.
- Select Add.
- Associate the Workflow with your project.
Now when members of the group create an issue the Security Level will be set to the one you configured for this post-function.
Resolution 3
This is another add-on which could update the security level via Automation.
- Go to Project settings > Project automation
- Click on Create rule
- New trigger: Issue created
- New Condition: User condition
- User - Reporter
- Check to perform - User is in group
- Criteria - <your group names>
- New Action: Edit issue
- Choose "Security Level" field from the drop-down menu
Notes: The default Security Level must be "None". If not, the default security level will overwrite the update of automation.
JIRA Cloud: Automation Lite for Jira Cloud
JIRA Server: Automation Lite for Jira
Pro version (Cloud & Jira): Automation for Jira