On this page


Example: Set security level based on groups and project roles the reporter or creator are in

Is there a way to set the Issue of ticket when created based on a group the User is in?  We want the default security to be open when an issue is created, but if a certain set of users create a ticket we want the security to be restricted.

Yes, you can set Security Level of an issue based on almost any circumstance you may imagine, and of course you can do it based on the groups or project roles one or more users are in.

To do it you can use post-functions Copy parsed text to a field using advanced parsing mode, or Set a field as a function of other fields using type 2 setting rules.

I explain you how to do it both ways. Let's suppose we want to set issue security level to "Restricted" if reporter or creator are in project role "Manager" or group "Bosses", otherwise security level will be set to "Public". I'm supposing that "Restricted" and "Public" are security levels in the Security Level Scheme of my project:

Using Copy parsed text to a field


Text to be parsed in this example is:

(isInGroup(%{00006}, "Bosses") OR isInGroup(%{00148}, "Bosses") OR isInRole(%{00006}, "Manager") OR isInRole(%{00148}, "Manager")) ? "Restricted" : "Public" 

Note that:

  • %{00006} is field code for "Reporter"
  • %{00148} is field code for "Creator"

Alternative Implementation

Using Set a field as a function of other fields

 


Setting rules used in this example are:


[isInGroup(%{00006}, "Bosses")]Restricted
[isInGroup(%{00148}, "Bosses")]Restricted
[isInRole(%{00006}, "Manager")]Restricted
[isInRole(%{00148}, "Manager")]Restricted
[true]Public 

The difference between "Reporter" and "Creator" is that the creator is de user who actually created the issue, and because of that can't be edited, while the reporter is the user who informed about the issue, and can be edited if your have the necessary permissions to do it.



Other examples of that functions

 Copy parsed text to a field


Set a field as a function of other fields