Hi All,
I have a workflow button "In progress" which helps me to move forward in the ticket life cycle.
In the workflow post function: I want 2 things to happen:
1) Update a Select list based on a condition: I am using below script for this:
cf.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(cf), option), changeHolder);
2) Since I am using 5 select lists, based on their values, i need to move ticket to a particular stage in workflow, say "Intermediate". I am using the below script for this:
WorkflowTransitionUtil workflowTransitionUtil = JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class);
workflowTransitionUtil.setIssue((MutableIssue)issue);
workflowTransitionUtil.setUserkey(currentUser.getKey());
workflowTransitionUtil.setAction(301);
if (workflowTransitionUtil.validate().getErrorMessages().size() == 0)
{
workflowTransitionUtil.progress();
}
2 scripts in my post function, however to execute them both, I need to press "In progress" button twice in my Ticket view window.
Am i missing something ? is there way to combine both the scripts to 1 to avoid pressing the button twice?
Please help
i need to move ticket to a particular stage in workflow, say "Intermediate"
Workflow transitions in post function scripts is generally a bad idea. Please reconsider your workflow.
"generally a bad idea" - that is a very polite way of saying "do not do this".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- @Danyal Iqbal
the requirement states that based on the value of 5 Select lists(which are updated via post function) , ticket either needs to move to Stage A or B or C.
Any other way to accomplish this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use Scriptrunner's "fast track transition" function. This moves an issue on without the horror of trying to do a transition inside a transition inside a transition inside a transition inside a transition inside a transition inside a transition ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Nic Brough -Adaptavist-.
But with the help of Fast Track Transition an issue, can the transition for subtasks also be made i.e.
based on the value of 5 Select lists(which are updated via post function in the parent), if subtask needs to move to stage A or B or C?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is not what your original question asked.
You can transition other issues in a post-function, you don't need the fast-track - that is only for the current function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.