Hi,
I have a custom field which is of multi select and it stores only the key. In order to fetch the value I'm writing a listener event during creation and updating event where the key will be converted from string to list and then iterating the list to get the summary.
The summary is being iterated for the first element in the list.
However, the iteration is not successful and throws the below error:
Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: <inline script> java.lang.NullPointerException: Cannot invoke method getSummary() on null object at com.atlassian.jira.issue.Issue$getSummary$9.call(Unknown Source)
wordlist = new ArrayList(Arrays.asList(str))
wordlist.each{
def value = it.toString()
if(it){
def issueTex = issueManager.getIssueObject("${value}")
def summary = issueTex.getSummary()
}
}
Hello @Gowri_Sankar I'm not sure of what you are trying to achieve, but basically you are getting a nullpointer exception.
def issueTex = issueManager.getIssueObject("${value}")
This line does not seem to return a value and issueText is left empty. In the next line, issueText is traing to call the method "getSummary", but due to it being empty, you receive a NullPointer Exception.
I hope this was of any help.
Thanks. Yes correct, but considering a list has 3 values. On the first iteration the getSummary is executed. But on further iterations, this returns null. To make sure the value is present I have added an if loop inside for loop. On second, iteration it is iterated for IF but when trying to access issueManager.getIssueObject the variable returns null.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.