Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Auto transition parent based on all linked issue custom-field value

siddhesh
Contributor
February 4, 2019

Hi,

 I have parent issue with type "Task".  With this issue I have multiple linked issue which has type "Test". 

I also have custom-filed, which has value Yes/No in drop down filed for child ("Test") issue

Now, I want to auto parent("Task") transition based on child ("Test") custom-field value. This field will update on child transition

I have script runner as well as JSU plugin installed.

Regards,

Siddheshwar

3 answers

0 votes
balaji May 7, 2020

Hi @Antoine Berry @Vishnukumar Vasudevan 

Hi have same requirent that 

i need to trigger parent(theme) transition called DEFINITION only when child issue has below condition E.g if at least 1 epic  in status called "in progress" and at least 1 epic B in "done" then it should auto trigger the parent issue called theme, 

Do you have any script to achive this.

 

Thanks!

0 votes
Antoine Berry
Community Champion
February 5, 2019

@siddhesh Hi,

You could use this code to trigger your parent transition : 

import com.atlassian.jira.workflow.WorkflowTransitionUtil
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor

Issue parentIssue = issue.getParentObject()
int transitionId = 51
def authenticationContext = ComponentAccessor.getJiraAuthenticationContext()

WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class );
workflowTransitionUtil.setIssue(parentIssue);
workflowTransitionUtil.setUserkey(authenticationContext.getLoggedInUser())
workflowTransitionUtil.setAction(transitionId);
workflowTransitionUtil.progress();

Let me know if you need the code to test your custom field as well.

0 votes
Vishnukumar Vasudevan
Community Champion
February 4, 2019

Hi,

I think you have two options two try out:

1). Write a custom script post-function - Using script Runner

2). See "Transition on linked issue" post-function from JSU can help here. I am not sure if this has any conditional execution available. 

 JIRA Misc Workflow Extensions plugin a a built-in post-function to meet this requirement.

Thanks, Vishnu.

siddhesh
Contributor
February 4, 2019

Hi,

I am trying to user script post function.

Do you have any scripts for the same?

Regards,

Siddheshwar

Suggest an answer

Log in or Sign up to answer