@Nonnull @Override public String getNextStatusIdForAction(@Nonnull final Issue issue, final int actionId) { JiraWorkflow workflow = getWorkflow(issue); if (workflow == null) { throw new IllegalStateException("There is no workflow for the issue with key " + issue.getKey()); } ActionDescriptor action = workflow.getDescriptor().getAction(actionId); if (action == null) { throw new IllegalStateException("There is no action descriptor for an action with id " + actionId); } int stepId = action.getUnconditionalResult().getStep(); if (stepId == JiraWorkflow.ACTION_ORIGIN_STEP_ID) { return issue.getStatusObject().getId(); } StepDescriptor step = workflow.getDescriptor().getStep(stepId); return workflow.getLinkedStatusId(step); }