Changing issue security level from a custom groovy post function

Changing issue security level from custom groovy post function shows that the security level has changed in the 'Activity' however the issue security level still remains as it was before. The user performing the operation has the permissions to set issue security level as well.

This post function checks the selected option from a single choice drop down and according to the selected value an issue security level should be set for the issue the post function was triggered from, however this is not changing as described above.

Note: the user can change the issue security level manually and the update validation result returns no errors in fact it is being valid

Thanks in advance.

1 answer

Hi look use this groovy:


/* Variables */
CustomFieldManager customFieldManager     = ComponentAccessor.getCustomFieldManager()
MutableIssue issueMutable              = issue;
CustomField cfTypeSupport = customFieldManager.getCustomFieldObject("customfield_" + oLectorProperties.getProperty("typeofsupport"))

try {

   String contentValue = issueMutable.getCustomFieldValue(cfTypeSupport)
   oLog.escribir("Typo soporte: " + contentValue.trim())
   if(contentValue.trim().equals("Dudas y Soporte experto")){
      oLog.escribir("SETEA SECURITY")

} catch (Exception eException) {

   oLog.escribir(" > Exception > " + eException.getMessage());
}catch (NumberFormatException nFException) {
   oLog.escribir(" > Exception > " + nFException.getMessage());

good luck

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

124 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