How to remove a deleted status from a workflow

Aaron Shumway March 28, 2019

I added a status to a draft workflow. Before publishing the workflow, that status was deleted. Now the status cannot be removed from the workflow.

Error message when trying to delete: The Jira server was contacted but has returned an error response. We are unsure of the result of this operation.

First few lines of 375 line long stacktrace in error response:

java.lang.NullPointerException

  at com.atlassian.jira.plugins.workflowdesigner.workflow.WorkflowStatuses.verifyStatusCanBeRemoved(WorkflowStatuses.java:269)

  at com.atlassian.jira.plugins.workflowdesigner.workflow.WorkflowStatuses.removeStatus(WorkflowStatuses.java:160)

  at com.atlassian.jira.plugins.workflowdesigner.rest.WorkflowStatusesResource.removeStatus(WorkflowStatusesResource.java:88)

...

 

It feels like a bug, but is there a workaround that can be done to remove the deleted status?

2 answers

1 accepted

0 votes
Answer accepted
Aaron Shumway March 29, 2019

Turns out this is a bug in the diagram editor and in the delete status logic. Steps to reproduce:

  1. Using the Diagram editor, edit an active workflow
    • It will be in draft edit mode
  2. Add a new status
  3. From the Statuses screen delete the status
    • First bug: it thinks the status isn't associated with a workflow, even though it is associated with the draft workflow, so it allows you to delete the status
  4. Try to delete the status from the draft workflow using the Diagram editor
    • This fails, but should work even though you can't delete statuses from a draft workflow because the status hasn't been published
    • Second bug: the NullReference in WorkflowStatuses.java at line 269

The work around:

  • Delete the status using the Text workflow editor
    • This works because it's using the `workflowStepId` instead of the deleted `statusId`
0 votes
Fadoua
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2019

@Aaron Shumway 

When a workflow is published you can not delete anything from it.

  • Make a copy of your workflow.
  • Copy will be under inactive workflows
  • Remove the unneeded status
  • Publish the new workflow

Best,

Fadoua

Aaron Shumway March 29, 2019

That's how you would delete a published status, but this was a draft and the status hadn't been published with the workflow.

Like Farida Musayeva likes this
Fadoua
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 29, 2019

Did you try to click on the status and delete it?

Is this workflow published?

Aaron Shumway March 29, 2019

Yes, to both questions. I did figure out a work around yesterday, but didn't get around to posting it on here. I'm in the middle of writing it and will have it posted shortly.

Suggest an answer

Log in or Sign up to answer