JIRA NullPointerException when switching Workflow scheme

Loredana July 31, 2013

Hi all,

I have a problem since I imported a workflow as xml and assigned it to a production project. The workflow itself worked fine on my test system and also looked fine as a diagramm in production.

I noticed in production that in the Workflow Text-Modus 3 Step-Names are not linked with the proper Status and 2 don't have any:

Now, although I changed this missfits, I can't assign the new Workflow (Workflow-Scheme) or the old one to the Project, since I keep getting the same java.lang.NullPointerException:

Cause:
java.lang.NullPointerException

Stack Trace: [hide]

java.lang.NullPointerException
	at com.atlassian.jira.web.action.admin.workflow.scheme.SelectProjectWorkflowSchemeStep2.getSelectListName(SelectProjectWorkflowSchemeStep2.java:255)
	at com.atlassian.jira.web.action.admin.workflow.scheme.SelectProjectWorkflowSchemeStep2.addMigrationMappings(SelectProjectWorkflowSchemeStep2.java:181)
	at com.atlassian.jira.web.action.admin.workflow.scheme.SelectProjectWorkflowSchemeStep2.doExecute(SelectProjectWorkflowSchemeStep2.java:120)
	at webwork.action.ActionSupport.execute(ActionSupport.java:165)
	at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:82)
	at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)
	at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
	at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
	at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35)
	at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:221)
	at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:150)
	at com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher.java:153)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
...


Can anyone help please?
Many thanks!

4 answers

1 accepted

1 vote
Answer accepted
Loredana July 31, 2013

Problem solved:

https://confluence.atlassian.com/display/JIRAKB/%27NullPointerException+in+SelectProjectWorkflowSchemeStep2.getNumAffectedIssues%27+Due+to+Workflow+Step+that+Doesn%27t+Have+a+Linked+Status?src=search

Two steps had no linked statuses, therefore the nullpointer exception.

I created two temporary statuses (Administration >> Issue Settings >> Statuses > Add New Status). These new statuses automatically got the id's that were missing, and that the pointer was pointing to. After that the exception was gone and I could replace the scheme.

0 votes
Loredana July 31, 2013

Sorry, we have v5.2.6

0 votes
Loredana July 31, 2013

The Jelly Script didn't work:

Could not run script.
Extra Information: [hide]

Error: <JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log">
Exception: org.apache.commons.jelly.JellyTagException: null:21:0: No such accessible method: addSchemeToProject() on object: com.atlassian.jira.workflow.DefaultWorkflowSchemeManager
java.io.PrintWriter@1f5e5a8e
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2013

on which version of jira you tried?

Stefan Niedermann November 27, 2013

i tried the same jelly script and get the same error (jira 5.1.8). do you have any information, how i can assign a scheme with jellyscript in my jira version?

regards

0 votes
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2013

try with the jelly script

&lt;JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log"&gt;
 
  &lt;!-- Grab managers. Do it using ComponentAccessor now which gives better compatibility in Jira 5! r --&gt;
  &lt;core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getWorkflowSchemeManager" var="workflowSchemeManager"/&gt;
  &lt;core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getProjectManager" var="projectManager"/&gt;
 
 
  &lt;!-- Get the project with key "MYPROJECT" using ProjectManager --&gt;
  &lt;core:invoke on="${projectManager}" method="getProjectObjByKey" var="project"&gt;
    &lt;core:arg type="java.lang.String" value="MYPROJECT"/&gt;
  &lt;/core:invoke&gt;
&lt;log:warn&gt;Project ${project} found&lt;/log:warn&gt;
 
  &lt;!-- Get the workflow scheme "myScheme" --&gt;
  &lt;core:invoke on="${workflowSchemeManager}" method="getSchemeObject" var="scheme"&gt;
    &lt;core:arg type="java.lang.String" value="myScheme"/&gt;
  &lt;/core:invoke&gt;
&lt;log:warn&gt;Scheme ${scheme} found&lt;/log:warn&gt;
 
  &lt;!-- Assign scheme to project --&gt;
  &lt;core:invoke on="${workflowSchemeManager}" method="addSchemeToProject" &gt;
    &lt;core:arg  value="${project}"/&gt;
    &lt;core:arg  value="${scheme}" /&gt;
  &lt;/core:invoke&gt;
 
 
&lt;/JiraJelly&gt;

check this

https://answers.atlassian.com/questions/47591/associate-workflow-schema-to-project-using-jelly-script

Suggest an answer

Log in or Sign up to answer