Hi
I need to add a validator to story workflow as below
Transition is from in progress to in analysis
Validator is ...the sub tasks with request type field which contains values A ,B should be closed
How can I add this ?
Hello,
Below code might help. Bear in mind that I did not test it
WorkflowManager workflowManager = ComponentAccessor.getWorkflowManager();
JiraWorkflow workflow = workflowManager.getWorkflow(issue);
workflow.getLinkedStep(status).getActions();
Nice one, that worked a treat.
For the current status I've used it as follows
workflow.getLinkedStep(issue.getStatus()).getActions();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tuncay Senturk _Snapbytes_
Please
I'm trying too work with a code like this but...
how can i get the results ??
I've read Atlassatian OnLine Documentation and I saw that "getLinkedSetp" method returns
com.opensymphony.workflow.loader.StepDescriptor
I would like to get the possible transitions (actions) basead on a issue state, just like the code above.
But, I have to fire a transition if I found a particular action.
So, I must handle the Action Name (to search) and the Action ID (to fire) of the actions returned by "workflow.getLinkedStep( issue.getStatus()).getActions()
Is it possible?
Thanks in Advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Forget it
I get it
import com.atlassian.jira.workflow.WorkflowManager
import com.atlassian.jira.workflow.JiraWorkflow
import com.opensymphony.workflow.loader.ActionDescriptor
JiraWorkflow workflow = ComponentAccessor.getWorkflowManager().getWorkflow( _issue_ )
ActionDescriptor action
int actionID = 0
def actions = workflow.getLinkedStep( issuePai[0].getStatus() ).getActions().iterator()
while ( actions .hasNext() )
{
action= (ActionDescriptor)actions .next()
if( action.getName() == "my condition")
actionID= action.getId()
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.