Unable to utilize imported or restored workflow in Jira server

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

  1. After a XML restore or workflow import, a linked status has as a NULL value.

  2. Users are not able to use the workflow once it's active. If they try, a NullPointerException is thrown.
  3. Users get an IllegalArgumentException when attempting to to publish the draft workflow

  4. Loading an Agile Board for the affected project might result into errors.

One of the following appears in the atlassian-jira.log:

2011-02-08 14:50:26,111 http-8080-7 ERROR user 890x362x1 1qdw44h 0:0:0:0:0:0:0:1 /secure/project/SelectProjectWorkflowSchemeStep2!default.jspa [webwork.util.ValueStack] METHOD: "numAffectedIssues", exception:
java.lang.NullPointerException
    at com.atlassian.jira.web.action.admin.workflow.scheme.SelectProjectWorkflowSchemeStep2.getNumAffectedIssues(SelectProjectWorkflowSchemeStep2.java:182)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
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)
2014-09-18 17:24:12,627 ajp-bio-127.0.0.1-8080-exec-48674 INFO admin 1044x20709271x4 1bcqfam 10.10.10.2 /issues/ [jira.jql.context.StatusClauseContextFactory] Workflow: 'test workflow' associated with project: '10000' and issue type: 'default' contains a null status, you might want to fix that.
java.lang.IllegalArgumentException
	at com.atlassian.jira.workflow.AbstractJiraWorkflow.getLinkedStep(AbstractJiraWorkflow.java:199)
	at com.atlassian.jira.bc.workflow.DefaultWorkflowService.validateOverwriteWorkflow(DefaultWorkflowService.java:437)
Exception: Uncaught TypeError: Cannot read property 'errors' of undefined
Resource: http://10.117.8.44:8080/GHS-116450/s/45a2104f4497b88b2f3af9a18580d5a6-CDN/-ln9hzm/79001/03fafac7ef96d0fe1462ba2c1c1b64f3/a232651f5da4f9678764ecf636a7384d/_/download/contextbatch/js/greenhopper-rapid-non-gadget,atl.general,gh-rapid,jira.project.sidebar,jira.general,com.atlassian.jira.projects.sidebar.init,jira.global,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&healthcheck-resources=true&is-server-instance=true&is-system-admin=true&jag=true&jaguser=true&locale=en-US&nps-acknowledged=true&nps-not-opted-out=true&whisper-enabled=true
Line: 307809
Column: 64

Cause

There is an inconsistency in the workflow XML. There is a inked status id referenced in the workflow xml but the status does not exist in the database.

(info) If the linked status entry isn't part of the workflow XML, it is assumed a NULL value.


Diagnosis

Looking into the affected workflow, we should be able to see broken Statuses : 

Resolution

  1. Find the ID of NULL linked status entry:
    1. Go to Workflows in JIRA Administration. Export the workflow as XML.
    2. Using an external XML viewer or text editor, open the file and search for the step related to the linked status. You'll find something like:

        <step id="3" name="STEP">
                  <meta name="jira.status.id">10007</meta>
                  <actions>
                    <action id="41" name="To Integration">
                      <meta name="jira.description"></meta>
                      <results>
      

      (info) The data between <meta name="jira.status.id"> and </meta> refers to the ID of broken linked status.

  2. Create a temporary status which will be used to replace NULL value in workflow. (warning) Restart required.

    Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.


    1. Go to Administration >> Issue Settings >> Statuses. Select Add New Status. Add a new status called "TEMP".
    2. Run the following query on your JIRA database:

      SELECT * FROM issuestatus;
    3. In results, search for the ID of new status TEMP. If the TEMP id matches the ID previously found on workflow XML, your problem is solved. The null value has been replaced.

      In case this value doesn't match, you'll need to set the ID manually. On your database, run:

      UPDATE issuestatus set id='<ID>' where pname='TEMP';

      Run the previous select again in order to check if this last command ran okay.

  3. Restart your JIRA Instance. For JIRA Data Center, a rolling restart was found sufficient.
  4. Finally, go to Administration >> System >> Integrity Checker and run it.
Last modified on Oct 14, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.