Handling Jira Statuses With Transitions

When it comes to changing the status of an issue, JIRA has slightly different approach from most tools. JIRA is a workflow-based tool, which means the status of an issue cannot be changed by updating the issue with a new status value. Instead, you need to do a transition to the issue. Transition is a pre-defined object, that describes a move between different statuses.

For example.

  • To move the status from Open to In Progress, you need to set a transition Start working to the issue.
  • To move the status from In Progress to Resolved, you need to set a transition Resolve to the issue.

With integrations, this brings additional things to consider. First of all, to be able to set a correct transition, you need to know the current status of the Jira issue before the needed update. This can be done by saving (and updating) this value in a conversation attribute in Service-Flow. Remember that this mapping needs to be included in both directions.

The following table shows an example how to do the mapping according to the pre-stored JIRA status and the status included in the inbound message from the other tool.

New tool StateLast JIRA Status
Transition (id)JIRA to state
AssignedOpen->Accept (id=1)Accepted
Illegal transition
In ProgressAccepted->Start working (id=2)In Progress
Illegal transition
Awaiting customerIn Progress->Start Waiting Customer (id=3)Awaiting Customer
PendingIn Progress->Start Waiting 3rd Party (id=4)Awaiting 3rd Party
ResolvedIn Progress->Resolve (id=5)Resolved
ANYIn Progress
Illegal transition
In ProgressAwaiting Customer->Set In Progress (id=6)In Progress
ANYAwaiting Customer
Illegal transition
In ProgressAwaiting 3rd Party->Set In Progress (id=6)In Progress
ANYAwaiting 3rd Party
Illegal transition
ClosedResolved->Close (id=7)Solved
In ProgressResolved->Reopen (id=8)In Progress
Illegal transition

As you can see, there is usually a technical possibility to set a wrong state in the other tool, which then results as an error in the workflow. There are usually two different ways to handle this problem.

  1. Trying to set an illegal transition to the JIRA issue will result in a synchronous error response. A rule in Service-Flow can be set to forward this error back to the ticket from where the illegal state was triggered. With this information, the user is then able to fix the wrongly set status value.
  2. There is a possibility to configure JIRA so that Service-Flow integration will have dedicated transitions. With this option, the status mapping configuration becomes in most cases significantly less complicated, but in some cases the policy of the tool/process does not allow it. You can find the guide to implement this here.