Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to check status of relatedIssue.portfolioChildIssues

Digvijay Singh Gehlot
Contributor
November 5, 2024

Hi Community, 

I am using JMWE post function "Transition Issue" On child workflow to transition the Parent when Child moves to next status. 

I want to enable Condition Exception where I am passing groovy script

relatedIssue.portfolioChildIssues

Which gives me the Array List of all child issues linked to the Parent. 

I also want to see what is the Current Status of those Children which are linked to Parent. 

Please help with groovy script condition on how to pull the Current Status of Child Issues of the Parent in Condition Exception in Transition Issue (JMWE) post function. 

Thanks

 

 

1 answer

1 accepted

2 votes
Answer accepted
Pablo Vergara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 11, 2024

Hi @Digvijay Singh Gehlot 

This should be pretty straightforward with JMWE.

Let's say you need to check that those child issues are in a specific status (for example, "Done"); then you can use a condition like issue.portfolioChildIssues.every(it -> it.status.name == "Done") on the Transition issue(s) post-function to check that all child issues are in that status before the post-function is executed.

(note that you don't need to use the relatedIssue global variable)

Screenshot 2024-11-11 100901.png

Besides that, let's say you want to just return a list with all the statuses for those child issues. In that case, you can use the Groovy code snippet below:


def statuses = [];
for (i in issue.portfolioChildIssues) {
statuses.push(i.status.name)
}
return statuses;


If you need further support, you can always reach the JMWE support team by visiting the support portal at Appfire Support Portal - their engineers will be more than happy to help you!

- Pablo / SSE - ServiceRocket

Digvijay Singh Gehlot
Contributor
November 12, 2024

Hi @Pablo Vergara 

Thank you for your message and it helped.

May you further guide me with the below use-case:

1) Parent Workflow and Child Workflow are having the same statuses

2) I want to fulfil the below scenarios:

a) When all Children of a Parent (linked via Parent Link field), transition to Prioritized, then Parent will also transition to Prioritized.

b) When some Children transition to Prioritized and other transition to either Not-Prioritized or Cancelled, then Parent should only move to Prioritized, irrespective to those Children moved to Not-Prioritized or Cancelled.

c) When all Children are transitioned to Not-Prioritized, then Parent should move to Not-Prioritized.

d) When some Children are transitioned to Not-Prioritized and other are moved to Cancelled, then Parent should only move to Not-Prioritized, irrespective to those Children moved to Cancelled. (Here, No Children have moved to Prioritized)

e) When all Children are moved to Cancelled, then Parent should move to Cancelled. (Here, No Children have moved to Prioritized and Not-Prioritized).

Could you help how I can achieve this by passing a Conditional execution in Transition Issue post-function using JMWE app?

Looking forward to hearing from you soon.

Thanks

Pablo Vergara
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 12, 2024

Hi @Digvijay Singh Gehlot 

Since that would require more analysis and considerable effort/time, you would have to create the proper support request on the Appfire support/customer portal: Appfire Customer Portal so the team can handle the load.

I would suggest creating two tickets, so 1 for a), b), and c) and an extra one for d) and e), so the workload can be balanced among the support members, and you receive faster response times.

Best regards,

- Pablo

Suggest an answer

Log in or Sign up to answer