issue = finance
subtask= 1.bills due
2.bills cleared.
can i change the transition of the subtask (bills due ) to resolved automatically when the subtask ( bills cleared ) is resolved.
Hi,
You would need an automation, or even better a scripting add-on.
From there, sure you can and also much more.
Br
we are using BOB SWIFT CONFIGURATION and JSU,
but as i check the configuration , its confusing,
if i need to transition a second subtask to resolved if the 3rd sub task is resolved.
can you help me with the fields to choose
ose ( please check the screenshot)
I'm not so familiar with BobSwift, however the link relation between two subtasks does not exits.
In theory they are not linked at all with each other. Parent/Subtask relation exists only 1to1 (parent to/from subtask)
EXACTLY, so do i have to try any script , i think i can work it out with automation,
can you suggest any other options u are aware of ,
Thankyou.
Hello @siva,
I wrote a script for you. This script works if there is a transition between subtasks' current status and resolved status. By the way, I thought there might be more than 2 subtasks. Therefore, I used for loop. Hope this helps.
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.Issueimport com.atlassian.jira.user.ApplicationUserimport org.apache.log4j.LoggerLogger log = Logger.getLogger("Your script name")log.debug ("Script started")try { ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() Issue currentIssue = issueif(currentIssue.getIssueTypeId() == "subtask id" && currentIssue.getStatusId() == "resolved status id"){ Issue parentIssue = currentIssue.getParentObject() // finance issue List<Issue> subtasks = parentIssue.getSubTaskObjects()for(Issue subtask : subtasks) changeStatus(subtask,currentUser) }}catch(Exception e){ log.error(e)}private void progressTransition(Issue issue, ApplicationUser currentUser){ WorkflowTransitionUtil workflowTransitionUtil = JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class ) workflowTransitionUtil.setIssue(issue) workflowTransitionUtil.setUserkey(currentUser.getKey()) workflowTransitionUtil.setAction("action id") workflowTransitionUtil.validate() workflowTransitionUtil.progress()}
Regards
Orkun Gedik
Thanks a lot let me test it out .
Let me know if you need help. Good luck.
It looks like you're new here. Sign in or register to get started.