Hi Atlassians,
I'm developing a postfunction that allows transitioning issues after the current transition is completed, based on a certain condition. In other words, this post-function will automatically transition an issue if the provided condition holds true.
In the configuration page of that postfunction, I'm displaying all ActionDescriptors of all workflows (as shows below snapshot).
Inside the method getVelocityParamsForInput of AutoTransitionPostFunctionFactory, I have the following:
@Override
protected void getVelocityParamsForInput(Map<String, Object>velocityParams){
Collection <JiraWorkflow> workflows = workflowManager.getWorkflows();
List<String> listActions = new ArrayList<String>();
for(JiraWorkflow jiraWorkflow : workflows)
{
Collection<ActionDescriptor> actions = jiraWorkflow.getAllActions();
for(ActionDescriptor action : actions)
{
listActions.add(action.getName()+ " (" +action.getId()+")");
}
}
velocityParams.put(TRANSITION_CONDITION, "");
velocityParams.put(WORKFLOW_ACTIONS_LIST, listActions);
}

This code gets all ActionDescriptors of ALL workflows. Is there a way to know the current workflow inside AutoTransitionPostFunctionFactory to get ActionDescriptors of the current one instead of loading all ActionDescriptors of ALL workflows?
Thanks,
Rosy