NullPointerException when creating an issue
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Only one user couldn't create the issue and the following appears in the atlassian-jira.log:
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: -------
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getValueFromIssue' in class
com.atlassian.greenhopper.customfield.epiclink.EpicLinkCFType threw exception com.atlassian.cache.CacheException: java.lang.NullPointerException at
com.pyxis.greenhopper.jira:gh-epic-link/templates/greenhopper/jira/customfield/epiclink/edit-epiclink.vm[line 37, column 57] at
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337) at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284) at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262) at
org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507) at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:155) at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262) at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) at org.apache.velocity.Template.merge(Template.java:328) at org.apache.velocity.Template.merge(Template.java:235) at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381) at
Diagnosis
Look for create issue transition from the workflow xml. For example:
<validator name="" type="class">
<arg name="FIELD_ERROR_MSG">You dont have permission to create Defects</arg>
<arg name="class.name">com.onresolve.jira.groovy.GroovyValidator</arg>
<arg name="FIELD_FORM_FIELD"></arg>
<arg name="FIELD_CONDITION"> !isUserMemberOfRole('Customers')</arg>
<arg name="scriptFileName">com.onresolve.jira.groovy.canned.workflow.validators.SimpleScriptedValidator</arg>
</validator>
Cause
Workflow validator is blocking the user to create an issue.
Resolution
Remove the validator or fulfil the validator criteria. For example, remove the user from the 'Customers' project role
<validator name="" type="class"> <arg name="FIELD_ERROR_MSG">You dont have permission to create Defects</arg> <arg name="class.name">com.onresolve.jira.groovy.GroovyValidator</arg> <arg name="FIELD_FORM_FIELD"></arg> <arg name="FIELD_CONDITION"> !isUserMemberOfRole('Customers')</arg> <arg name="scriptFileName">com.onresolve.jira.groovy.canned.workflow.validators.SimpleScriptedValidator</arg> </validator>