Move Parent (Initiative) to next status based on Child status and custom field value in Jira DC

Digvijay Singh Gehlot September 29, 2024

Hi Community,

I have a Parent (Initiative - issuetype) in Parent Project and Children are linked with "Parent Link" custom field in 5 different Child Projects.

My use-case is:

  • In Child Projects, when Children (Portfolio Epic) are present in "Prioritized" status and the custom field is set as Yes, then in Parent Project, the Parent (Initiative) should move to "Prioritized" status, irrespective of it's other Children which are not in "Prioritized" status and the custom field is answered as No.

What configured currently:

  • I created a JQL filter name "Children are Prioritized and answered as Yes":
    (project = "Child 1" OR project = "Child 2") AND issuetype = "Portfolio Epic" AND status = "Prioritized" AND "Custom Field" = Yes AND "Parent Link" is not EMPTY
  • I am passing this Filter query in another JQL query: issueFunction in portfolioParentsOf("filter = 'Children are Prioritized and answered as Yes' ")
  • I am running a Post Function: "JQL query matches condition" in Parent Project transition.

But I am facing the below issues with Parent issue transition in Parent Project based on it's Children transition.

  • For example: A Parent 1 (in Parent Project) has 5 Children (linked with Parent Link in their respective projects).
  • Expected Result: When 3 Children are in Prioritized status and answered as Yes, AND 2 Children are in Non-Prioritized status and answered as No, then only the Parent should move to "Prioritized" status in Parent Project.
  • Current Problem: When atleast one of the Children moves to Prioritized status with answer Yes, then Parent will also move to Prioritized status in Parent Project, without checking the Expected Result condition.  

I hope I tried my best to explain my scenario. I need further guidance on how to move the Parent issue only when - those Children which are in Prioritized status and answered Yes, irrespective to those children which are in Non-Prioritized status and answered No.

Please help in configuring the above Condition/Validation/Post-Function via scriptrunner, JMWE-app.

Thanks

1 answer

0 votes
Digvijay Singh Gehlot September 30, 2024

Hi Ram Kumar Aravindakshan

May you guide me further with my mentioned use-case by using scriptrunner?

It would be a great learning for me.

Thanks

Suggest an answer

Log in or Sign up to answer