Hello to Everyone!
So I'm basically trying to do automation for a roll up from the custom fields "Target start" and "Target end" when a story or a work change any of this both fields.
I would like to reflect on the Epic level the earliest Target start from all the stories, and the latest Target end from all the stories. This automation should be able to update even when we remove stories or add stories to the epic, or just update dates.
I followed this pages for reference:
The automation that I have built until now looks like this so far:
So there is goes my questions:
Thank you all in advance :)
Hi @RXAVIER
Before proceeding, I recommend checking if the Target Start and Target End fields are supported by automation rules. I recall earlier community posts that many Advanced Roadmap fields are not supported by rules. You can check this using this how-to article to confirm if the fields are supported for an example issue: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/ If you find the fields, they are supported.
Let's assume the fields are supported...
For your question #1 and #2, you are trying to update the epic with the earliest Target Start and latest Target End, correct? If so, the source for your edits should be the lookup results. Like this, filling in the correct values for the custom field ids:
{
"fields": {
"customfield_13603": "{{lookupIssues.Target End.max}}"
}
}
For Target Start, use the min instead of the max value.
For your question #3, please consider all of the scenarios you want to handle, as you may need separate rules with separate triggers:
Kind regards,
Bill
Thanks you @Bill Sheboy for you answer I think the automation is almost ready but I'm receiving the following error.
I already was reading this thread but I couldn't found the solution, I believe that my instance as date format as defined is there any walk around or way to check this out?
Thanks in advance,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is one of those situations where Atlassian decided to implement non-standard formats for date and date/time fields.
The fix is to force the field's format during the edit in the JSON to match the requested format. In this case, that would be jiraDate. Using my earlier example, we would add this:
{
"fields": {
"customfield_13603": "{{lookupIssues.Target End.max.jiraDate}}"
}
}
You can learn more about date/time smart values for similar situations here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for sharing that @Bill Sheboy didn't knew about it.
Even though I just tried to run it and got the same feedback from the JSON :(
This is the audit log (bellow is the JSON)
I didn't tried it for Target Start but I believe that the result would be quite the same. If you have any other option it would be really valuable.
Thanks in advance for you attention,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I see the problem: your source smart values may be incorrect in the lookup issues usage. This is my mistake as I did not check the fields before suggesting using JSON.
Smart values are name, spacing, and case-sensitive. When the wrong value is used, null is returned and often no error occurs. The correct smart values are "Target start" and "Target end".
Let's eliminate that possibility by using the field id instead, so please try this:
{
"fields": {
"customfield_14684": "{{lookupIssues.customfield_14684.max.jiraDate}}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bill Sheboy I just tried it like that but even though the result is the same as the image above even changing for the field id instead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This makes me wonder...
There are date fields in Jira which are not date or date/time type; instead they are text! Let's try to force the date type first:
{
"fields": {
"customfield_14684": "{{lookupIssues.customfield_14684.toDate.max.jiraDate}}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy you are the man :) it's working now completely fine with the JSON above. So this struggle with the date is over, thank you so much for your help.
Just one thing that I would like to ask you (that's connected to my 3rd point when I opened this discussion) I couldn't find a trigger for the automation when a child issue is removed. There is a way to trigger this in a automation?
Thank you a lot,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad that part is working for you!
To detect an issue (i.e., child) being removed from an epic, you can try the generic Issue Updated trigger, and then check the if the changelog is different for the epic link field with and advanced compare condition:
Followed by a condition to confirm the Epic link is now empty.
I believe that is the only way to do that check at this time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bill Sheboy I was checking in the triggers available and I was thinking to use this one:
But I have to admit that I'm confused where should I used that compare condition should be here just after the trigger?
Thank you in advance,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the child issue removed case, the rule must use the generic "Issue Updated" alone. Only then will the changelog work as I noted for detecting the case.
After that change you may add the advanced compare condition I suggested immediately after the trigger.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just made a run regarding the compare condition and it gave no update to the epic.
I believe that this is related because of the trigger, once it is pointing to update issue, and that is the work not the epic, in this scenario is trying to update the work I believe or am I missing something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are some missing pieces from your rule for this scenario. I noted these when I first suggested using the changelog:
These rule differences are why a separate rule is needed to handle the case of removing a child issue from the epic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I already added that extra condition to it and I used the Branch rule on JQL.
Even though is getting now a different error, saying that the Epic link was deleted.
That is actually correct but I want to use the one that was there when was trigged :) (I tried using the "{{triggerIssue.epic.key}}" at the JQL but the error was the same as shown bellow)
Thanks in advance,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let's try changing that second condition to check if
{{#changelog.Epic link}}{{toString}}{{/}} is empty.
And, the JQL for that branch should be:
key = {{#changelog.Epic link}}{{fromString}}{{/}} AND issueType = Epic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe we are almost there!
So in the more lower "Action details" you can see the error that the JQL ({{#changelog.Epic link}}{{toString}}{{/}} is empty) got.
I just tried by curiosity to execute it without the 2nd condition and we got success with the expected result. Even trying with issue fields condition it gives the error of Epic Link deleted.
Thanks for you attention,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the second condition I noted, you want an advanced compare condition and not a JQL condition:
Although your testing surfaces another case to cover: when the epic changes for an issue, both the old and new epic should be updated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bill Sheboy !
I changed to the advance compare condition as you said and it works fine now.
So yeah you are right the new epic is being update once covers the trigger of updated issue, but once the old epic is not taking any update the trigger is not covering it.
Do you have any idea how to force to run the lookup in the old epic?
Thank you in advance,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For that scenario, I believe the same rule can be used, with an adjustment...and I am paraphrasing here to only show the changes in italics :^) With this one, I believe you can remove the new condition we just added.
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.