Post Function for setting security level removes the transition permission from the user


I have written a groovy script to set different security levels to issue based on a customfield value. This code actually changes the security level but the it hides the transition/removes the permission to execute the transition from the users .

I want to set the issue security level and the transition also should be accessible for the users who have permission for that. 

Please check my code and suggest

My code goes here:

import com.atlassian.jira.ComponentManager; 
import com.atlassian.jira.ManagerFactory ;
import com.atlassian.jira.issue.IssueImpl;
import org.apache.log4j.Category ;
import com.opensymphony.workflow.loader.ActionDescriptor;
import com.atlassian.jira.issue.MutableIssue;
import org.ofbiz.core.entity.GenericValue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.bc.project.component.ProjectComponent;
import com.atlassian.jira.bc.project.component.ProjectComponentManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueFactory;

ComponentManager componentManager = ComponentManager.getInstance() ;
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def plant = customFieldManager.getCustomFieldObjectByName("Plant");
def plantValue = issue.getCustomFieldValue(plant) as String;

if( == "Plants")
log.debug("**********Received plant value*********");
else if(plantValue.contains("Patancheru")) 
else if(plantValue.contains("Ankleshwar")) 
else if(plantValue.contains("Kasna")) 
if( == "Non-Plants")


1 comment

The setting of the security level is what is removing the user's permission to act on the issue.

Thanks Nic for your reply.

The users are in the security level and have the transition permission also. then why the change in security level restricts the transition?I have tested it by adding Admin Id in a security level and created an issue. The same happens to me.


Log in or Join to comment
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,300 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot