Hello. I'm trying to provide a feature to our Jira users, which can show them, who can act on an issue in it's current state.
My idea is to show a list of transitions which are possible from current status and workflow and to give a list of users which can perform these transitions.
So, users who are stucked with an issue can check who can help out.
Unfortunately i did not come very far. I only came down to the place where is have the step (associated with the status) and the actions available at this step.
I have absolutely no idea, how to retrieve any further information about the actions and their conditions, to finally break them down to user names.
My code so far looks like this (as a starting point):
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.workflow.WorkflowManager
import com.opensymphony.workflow.loader.*
def issue = ComponentAccessor.getIssueManager().getIssueObject("XXX-123")
def workflowManager = ComponentAccessor.getComponentOfType( WorkflowManager.class )
def issueWorkflow = workflowManager.getWorkflow(issue)
def issueStatus = issue.getStatus()
//issueWorkflow.getName()
log.warn(issueStatus.getName())
def issueStep = issueWorkflow.getLinkedStep(issueStatus)
for (def act: issueStep.getActions()){
log.warn(' action:'+act.getName())
}
I would have thought, that these objects (to be retrieved by JiraWorkflow getters) would help, but i'm lost:
com.opensymphony.workflow.loader.ActionDescriptor
com.opensymphony.workflow.loader.StepDescriptor
...
Sorry, if my question does not look highly experienced. I'm not a Java/Groovy expert but until now was able to resolve most tasks with ScriptRunner.
Kind regards
Klaus