How to set issue security field based on the group membership of the reporter


I'd like to have a post-function for issue creation that updates the "security level" field if the reporter of the ticket belongs to a certain group. I haven't been able to find a way to do this with default add-ons or Jira Workflow Toolbox or with "update on transition" add-ons. 

How can I accomplish this? 

1 answer

1 accepted

2 votes
Accepted answer


You can do it using a scripting paid plugin like :

Power Scripts for Jira Script Automation (i used it )

ScriptRunner for JIRA

Scripting Suite Pro for JIRA,

or develop you own plugin , or using JavaScript which is not recommended

Okay, I tried PowerScripts for JSA. But I can't find hpw to specify if a user belongs to a group with a statement. Any ideas? 

Basically, I wan to do something along the lines of :

string security_level = "XYZ";
string user_group = "ABC";

if(isUserInGroup(reporter, groups, user_group)) {
security = security_level;}

 you could do it like this

If (userInGroup(user_group, reporter){

   security = security_level;


Thanks a lot. I think you missed a closing brackets, but I still get an error saying ">>if<<" is not defined. I really appreciate the help, but I'd not bother you if you could point me to a reference for the syntax. 

If (userInGroup(user_group, reporter))
security = security_level;

One last question, how do you refer to the "reporter" of an issue? I know currentuser() routine works ->

but how do I do the same for reporter? 

@Baybars Kumbasar

yes , you found a response :) 

the reporter is a standar variable you can look at this link it could help you a know all standard variables

Just if the answer is good , pleas could you accept it to help other

thanks in advance

Hi again,

the script looks good to me, it's the most simple script now:

if (userInGroup("XYZ", reporter));
security = "Level1";

But this doesn't work as expected: Even if the reporter is not a part of "XYZ" group, the issues are created wit "Level1" security level. The default is "Level0".  

Hi @Baybars Kumbasar

Maybe you should see the if the current user is the default level security Level0 else you should add else like this

if (userInGroup("XYZ", reporter));
security = "Level1";


security = "Level0";


Thanks for the response but the error was the semicolon at the end of the "if" statement. I don't feel particularly smart now. All works well now. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,095 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you