Let me explain my current situation.
I have 2 workflows defined for a Kanban Project:
My question is.
How can I define a Post Function Custom Script to automatically transition the Report Subtask when the other subtasks are resolved?
Do I need to create a link between the subtasks when they are created?
I made a research in the community and didn't found a something like this
Please make it as simple (for dummies) as possible.
So I got no answers but I found a solution if anybodyelse requires it:
I added the following Custom Scripted PostFunction in the transition from "REVIEW" to "DEFINED":
*The script transitions the subtask "Report" when the subtask "A" transitions to Defined
String currentuser = ((WorkflowContext) transientVars.get("context")).getCaller()
SubTaskManager subTaskManager = ComponentAccessor.getSubTaskManager();
if (issue.getIssueType().getId() == "55")//55 is ID for "A" subtask issue type
MutableIssue parent = issue.getParentObject() as MutableIssue;
WorkflowTransitionUtil workflowTransitionUtil = (WorkflowTransitionUtil) JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class)
Collection<Issue> subTaskList = subTaskManager.getSubTaskObjects(parent);
Iterator<Issue> iterator = subTaskList.iterator();
Issue subTaskObj = iterator.next();
if (subTaskObj.getIssueType().getId() == "59" || subTaskObj.getStatus().getId() == "26")//59 is the ID for "Report" subtask issue type & 26 is the ID for the status "Open"
workflowTransitionUtil.setAction(21)//21 is the transition ID from "Open" to "A - Defined"
Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events