You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
We are trying to get a Feature to automatically transition to 'In Progress', when one or all of the linked issues are also transitioned.
Hi Karl,
Assuming that the Feature should transition into In Progress status when the linked issue transitions from [To Do - In Progress], you may set up a Custom script post-function at this transition step.
There's a sample script in the Adaptavist Library that you may adapt to your use case: Transition an Issue using Issue Input Parameters
I modified it to fit your requirements, maybe not exactly but you may try this out. Also, I'm unsure if your issue can have multiple Features linked to/from it. However, this script takes that into consideration.
You can test this script in the Script Console & change it up as needed:
import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.issueLinkManager
def workflowManager = ComponentAccessor.workflowManager
def issueService = ComponentAccessor.issueService
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
// test issue - remove the following line when implementing post-function script
//def issue = ComponentAccessor.issueManager.getIssueObject('TEST-1')
// the name of action used to transition Feature(s)
final actionName = 'In Progress'
// the corresponding workflow id
def actionId = workflowManager.getWorkflow(issue).allActions.findByName(actionName)?.id
log.warn "actionId: " + actionId
// the name of the issue link type (taking into account the link direction - inward/outward)
final issueLinkName = 'Relates'
// if it's a Feature that's transitioning, don't run this script
if (issue.issueType.name == 'Feature') {
return
}
// find the Feature(s) linked to/from this issue
def featureInward = issueLinkManager.getInwardLinks(issue.id).findAll { it.issueLinkType.name == issueLinkName }?.sourceObject
def featureOutward = issueLinkManager.getOutwardLinks(issue.id).findAll { it.issueLinkType.name == issueLinkName }?.destinationObject
def features = featureInward + featureOutward
log.warn "featureInward: " + featureInward
log.warn "featureOutward: " + featureOutward
log.warn "features: " + features
features.each { feature ->
def issueInputParameters = issueService.newIssueInputParameters()
def transitionValidationResult = issueService.validateTransition(user, feature?.id, actionId, issueInputParameters)
assert transitionValidationResult.isValid(): transitionValidationResult.errorCollection
def transitionResult = issueService.transition(user, transitionValidationResult)
assert transitionResult.isValid(): transitionResult.errorCollection
}
I hope that this helps!
If this response has answered your question, please do mark it as Accepted to make it easier for other users to discover potential solutions to their questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.