Automatically set work item Security Level based on Jira 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
Summary
You're looking to set a security level based on whether the reporter of the issue belongs to a group that is in the security level.
Solution
Set security level using Jira Automation
Jira Automation (automatically included in Jira Cloud) allows you to automatically update work item fields, including security level, based on certain conditions.
Go to Project settings > Project automation
Select Create rule
New trigger: Work item created
New Condition: User condition
User - Reporter
Check to perform - User is in group
Criteria - <your group names>
New Action: Edit work item
Choose "Security Level" field from the drop-down menu
Notes: The default Security Level in your security scheme must be "None." If not, the default security level will overwrite the update of automation.
Automatically set security level using ScriptRunner
An alternative to Jira Automation leverages the popular add-on Script Runner.
Please note that Atlassian can not provide technical support for ScriptRunner functions. If you encounter problems you may need to contact the add-on vendor.
Create a copy of the current workflow
Edit the Workflow
Select the transition from Create to Open, then select post function
Select Add Post Function
Choose Script Post-Function and select Add
Select "Set work item 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 a work item the Security Level will be set to the one you configured for this post-function.
Was this helpful?