Hello, I run this code and get and error in my compare two values. It does not like me second value being 0 I believe and help would be great!
Hi @Lee Tarter -- Welcome to the Atlassian Community!
Without seeing the details of your Edit Issue Fields action, it is unclear what you are trying to do. Is this what you are trying to do:
GIVEN an Epic issue which has one or more child issuesWHEN the Due Date changes in a child issueOR WHEN the Start Date changes in a child issueTHEN update the parent Epic's Due Date to be the latest Due Date from its child issuesAND update the parent Epic's Start Date to be the earliest Start Date from its child issues
And, you do not state what you want to do in the cases of:
Let's assume those cannot happen...
For this scenario, none of conditions or extra expressions on the lookup JQL are needed. Instead use the max and min functions on the date fields:
Note this could also run if you use Sub-tasks, so perhaps change that first condition to look for exactly the issue types which can be children of your Epics.
Also, I agree with Trudy to use two separate rules (rather than combining as I show).
Two more ideas...as written, your rule handles changing the date fields of existing children in the Epic, but not the other cases. If you want to handle those also, additional rules with different triggers will be needed (using mostly the same logic):
Finally, if you need to handle empty / non-empty values for the child issues, a conditional expression could be used when the Epic's existing date values should be retained.
Kind regards,Bill
If I remove the compare two values portion. I deletes the due date of my epic(parent) issue.
Any help would be amazing
Hello @Lee Tarter
Welcome to the Atlassian community.
If the Lookup Issues action doesn't find any issues then the size attribute may be null rather than 0.
When using that attribute in conditions it is a best practice to use it this:
{{lookupIssues.size|0}}
That says to use the size attribute value if it is a number, and otherwise use the value 0 in the comparison.
Hello,
Thank you for the feedback.
I changed the value to what you had and I get the same error. "the following issues did not match the condition.
MY bigger problem now is when I remove the compare part of the rule, the edit part of the rule just removes my due date for the epic.
Any thought on why this happens?
{{lookupIssues.last.Duedate}}
That is what I have in the edit issue field at the end for due date
Please share with us the following:
Good Morning Bill! Thank you for the feedback. I made a rule based on your bulleted items and its working for now. I will most likely add cases for the numbered items like you said later, but for now its doing what I need.
Thank you all for the help!
It looks like you're new here. Sign in or register to get started.