Move Parent to next status, when some linked children answered Yes, and others answered No

Digvijay Singh Gehlot
Contributor
October 16, 2024

Hi Community,

I am working on Parent-Child linking automation between a Parent and Child projects.

I want to configure the below:

Parent P should only move to "Prioritized" (on Parent Board) when Children C1 and C2 are both answered Yes and moved to "Prioritized" (on Child Board) although C3 is answered No and moved to "Not Prioritized" (on Child Board).

I am struggling to configure the above case with running a Condition (Related Issues Status Condition) on Parent Workflow and a Post-function (Transition Issue(s)) on Child Workflow.

Please guide is there a way to the configure the same using scriptrunner, JMWE, or can you help me on how to configure it in Parent and Child workflows using Condition and Post-Functions.

Thanks

1 answer

0 votes
Jovin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 16, 2024

Hey @Digvijay Singh Gehlot 

Interesting use case and meanwhile I haven't investigated the use of conditions & post functions for this, you should be able to achieve this with the use of Automations and hidden custom fields.

My solution below:

  • Create a new custom field called "Can Prioritize" as a Select List (Single) with 2 options - "Yes" and "No"
    • Ensure you do not associate this with any screens (so it's a "background" field)
    • It's default value should be "No"

In the project where your "Child" issues are managed create the below automation rule:

  • Trigger: Issue Transitioned
    • From Status: Blank (any status)
    • To Status: Prioritized
  • Action: Lookup issues
    • JQL:
      parent = {{issue.parent}} AND status != Prioritized
    • This JQL finds out if ALL children of Parent P are in Prioritized, you could expand this to have a list of "valid" statuses instead of a single one
  • Condition: Smart values comparison
    • First value: {{lookupIssues.size}}
    • Condition: Equals
    • Second value: 0
  • Branch: Parent issue
    • Action: Edit issue
      • Field: Can Prioritize
      • Value: "Yes"

A screenshot of this can be found at the very bottom (note I used a placeholder Status and Custom Field).

Then you could add a condition to the workflow for the Parent to have "Field value" for "Can Prioritize" MUST BE "Yes".

Alternatively, if you want it automatically transitioned when value, you could also then add the below actions to the branch:

  • Action: Re-fetch issue data (so we get the latest version of the issue)
  • Action: Transition issue
    • To status: Prioritized

Screenshot of the basic automation rule:

Is Prioritizable.png

Suggest an answer

Log in or Sign up to answer