I'm trying to make automation that will choose earliest date from child ticket (start date field) and copy it to Parent ticket start date.
For instance Parent “Start Date“ = 01.02.2020, Child “Start Date“ = 01.01.2020, Child “Start Date“ = 01.03.2020 → Parent “Start Date“ = 01.01.2020.
I've created automation that collecting date from Child and adding to Parent, but it collect just any date, now it needs to be earliest date.
If anyone knows some JSON formula or Smart value and wants to share, that would be appreciated. Thank you in advance.
Current automation looks like this:
To confirm the problem you are trying to solve...you only want the Parent to change to the earlier date if a Child issue has one. Is that correct?
If so, couldn't you change your advanced compare condition in the branch to:
If instead you need the earliest date among all child issues, consider using Lookup Issues instead with JQL. That will handle the case of an issue changing parent when the dates do not change...and that may required a couple of rules with different triggers: field value changed for Start Date, and issue updated for a change in parent (both the incoming and outgoing parents could need updates).
Kind regards,
Bill
Hi @Bill Sheboy yes, this is correct, and I tried your solution, it works perfectly. Thank you very much for your help and also thanks to Jack for his suggestion!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would need to play with the rule (and if I get some time today I will) but I would approach this way...
update the parent date if empty or if it is > the date in the child issue that triggered the event using the following smartvalue context
Compares date1 to date2, to find which date is earlier. Returns:
-1, if date1 is earlier than date2
1, if date2 is earlier than date1
0, if the two dates are the same
Examples
{{issue.duedate.compareTo(now)}}
//returns
-1 or 1
{{now.compareTo(now)}}
//returns
0You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jack,
thank you very much for your quick response!
However, I tried your solution, but it must be that I did something wrong (lack of Jira experience). No error in audit log, just "no action performed".
Is this how automation should look like:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.