Skip to end of banner
Go to start of banner

issue.get("security") now returns a Long instead of a GenericValue

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Problem

After upgrading JIRA Misc Workflow Extensions to version 3.6.1 or JIRA Misc Custom Fields to version 1.6, scripts (in calculated custom fields or post-function execution conditions) that are using the following code will stop working:

issue.get("security").get("name")

This is due to a change in the JIRA API for accessing the Issue's Security Level. It now returns a Long (the Security Level ID) instead of a GenericValue.

Solution

You should modify the scripts that access the issue's security level through a call to issue.get("security"). You can either rely on the Security Level ID (a 5-digit numeric value), or use the IssueSecurityLevelManager to access the name of the Security Level:

if (issue.get("security") == 10000)
  [...]

or

com.atlassian.jira.issue.security.IssueSecurityLevelManager islm = com.atlassian.jira.ComponentManager.getComponent(com.atlassian.jira.issue.security.IssueSecurityLevelManager.class);
 
if ("A Security Level Name".equals(islm.getIssueSecurityName(issue.get("security"))))
	[...]

Filter by label

There are no items with the selected labels at this time.

  • No labels