Hi Team,
In project I have 4 different sub-tasks. Is there a way to close all subtasks when the parent Issue is closed ?Native solution, Plugin or Groovy script ?If yes, could you please provide the achieved code.
Thanks,
Phani
Hello @Kumar
You can do it with scriptrunner. Here further information
https://jamieechlin.atlassian.net/wiki/spaces/GRV/pages/33030170/Post+Functions#PostFunctions-Autocloseallsubtasks
Regards
Hi @Mohamed Benziane so I used the one query in that I just want know the sub-task I'd Where exactly I can find the Sub-task id so I have an 5 subtasks in my project here is query can tell me the what else I can make changes in that query
Can please help me
import com.atlassian.jira.component.ComponentAccessordef issueService = ComponentAccessor.getIssueService()def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()def subTasks = issue.getSubTaskObjects()subTasks.each { if (it.statusObject.name == "Open") { def issueInputParameters = issueService.newIssueInputParameters() issueInputParameters.with { setResolutionId("10000") // resolution of "Fixed" setComment("*Resolving* as a result of the *Resolve* action being applied to the parent.") setSkipScreenCheck(true) }// validate and transition subtask def validationResult = issueService.validateTransition(user, it.id, 5, issueInputParameters) if (validationResult.isValid()) { def issueResult = issueService.transition(user, validationResult) if (! issueResult.isValid()) { log.warn("Failed to transition subtask ${it.key}, errors: ${issueResult.errorCollection}") } } else { log.warn("Could not transition subtask ${it.key}, errors: ${validationResult.errorCollection}") } }}
HI @Kumar
Sorry i'm not a scriptrunner expert but if you want to retrieve an issueID i think this will help
getUnderlyingIssue()
It looks like you're new here. Sign in or register to get started.