Restrict issue creation per issue type and project role

Use case

In Jira it is not possible to restrict the creation of issues with specific issue types to certain user/ user groups/ project roles.

In the following use case, we restrict the issue creation depending on the selected issue type. Each issue type can only be created by a certain project role.

In this use case we assume that several issue types are using the same workflow.

If you have one workflow for each issue type, check out the corresponding use case.


โš’๏ธ Configuration

Add the validator to the create transition of the desired workflow.

Expression

Enter the following expression:

(%{issue.issueType} = "Bug" implies (isInRole(%{system.currentUser}, "Developers") or isInRole(%{system.currentUser}, "Software Testers"))) and
(%{issue.issueType} = "New Feature" implies isInRole(%{system.currentUser}, "Product Managers"))

Adapt the expression to your needs!

Above expression explained:

Selected issue type for new issue

Explanation

Bug

Only if the current user is in role Developers or Software Testers, the issue can be created.

New Feauture

Only if the current user is in role Product Managers, the issue can be created.

Any other issue type

Can be created by any user independent of any project role.

Error message

Enter the following expression in basic text mode:

You are not in the right project role for creating a new issue with the selected issue type "%{issue.issueType}".



๐Ÿ“ท Screenshots

RestrictIssueCreationPerIssueTypeAndProjectRole.png


๐Ÿ“š Related use cases