Dumping a workflow to show appropriate actions from all statuses

Gray Watson June 29, 2023

I'm using the following code to dump the workflow and show the appropriate actions from all steps in the workflow.  Anyone else have recommendations on what information could also be displayed.  I usually use this script to make sure that my transitions are correct.

import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.loader.ActionDescriptor

def issueManager = ComponentAccessor.getIssueManager()
def workflowManager = ComponentAccessor.getWorkflowManager()

def issue = issueManager.getIssueByCurrentKey("OSTP2-34")

def workflow = workflowManager.getWorkflow(issue)
log.debug("workflow " + workflow);
for (def status : workflow.getLinkedStatusObjects()) {
log.debug(" status = " + status.name + ", id " + status.id + ": " + status);
def step = workflow.getLinkedStep(status);
log.debug(" step = " + step.name + ", id " + step.id + ": " + step);
List<ActionDescriptor> actions = step.getActions();
for (def action : actions) {
log.debug(" action = " + action + ", id " + action.id + ": " + action);
}
}

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 1, 2023

Hi @Gray Watson

In your description, you mentioned:-

Anyone else have recommendations on what information could also be displayed.

That depends on what information you want. If you could specify the exact information you are trying to acquire, I may be able to suggest it.

Thank you and Kind regards,

Ram

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events