On this page

Use case

Within Jira you can use issue security levels to restrict the access to issues.

In the following use case we explain how to set the issue security level depending on the reporter.

Configuration

Add the Update field based on rules to the desired transition or create a new transition.

You can the post function to the create transition of the workflow so that the issue security level gets automatically set/ updated every time an issue is created.

Source field

Choose Reporter

Target field

Choose Security level

Rules

First rule

Select Text comparison

Source field value

Enter the name of the reporter, e.g.

agrant

Target field value

Enter the security level that should be set on the ticket when the specified user created the issue:

<security level>

Replace <security level> with the actual security level.

In this case, the specified security level  will be set, if the user agrant created the issue.

Second rule

Select Text comparison

Source field value

Enter the name of the reporter, e.g.

eparis

Target field value

Enter the security level that should set on the ticket when the specified user created the issue:

<security level>

Replace <security level> with the actual security level.

In this case, the specified security level  will be set, if the user eparis created the issue.

Proceed with the configuration like shown in the previous steps and adapt the rules according to your needs.

The current implementation works just fine, as long as security levels don't get renamed. If for e.g., the security level Team Dev is renamed to Development the above configured post function won't work correct anymore.

The following implementation is an alternative that even works after renaming security levels!

Alternative implementation using issueSecurityLevel()

Instead of entering the security level itself, we will use the parser function issueSecurityLevel() with the security level id.

Head over to your Jira Administration → Issues → Issue security schemes → Select the desired scheme

Hover over the Edit button of the desired security level and grab the id from the URL.


The URL might be something like:

http://your-domain.com/secure/admin/EditSecurityLevel!default.jspa?schemeId=10000

The id can be found at the end of the URL: schemeId=10000.

If the id of the security level Team Dev was 10000, the expression would be:


Update the above rules like follows:

First rule

Select Text comparison

Source field value

Enter the the username, e.g.:

agrant

Target field value

Set the parsing mode to Advanced Text and enter:

issueSecurityLevel(<id>)

Replace <id> with the actual id of the desired security level.

In this case, the security level with the specific id will be set, if the user with username agrant created the issue.

Second rule

Select Text comparison

Source field value

Enter the username, e.g.:

eparis

Target field value

Set the parsing mode to Advanced Text and enter:

issueSecurityLevel(<id>)

Replace <id> with the actual id of the desired security level.

In this case, the security level with the specific id will be set, if the user with username eparis created the issue.


Screenshots



If you still have questions, feel free to refer to our support team.