Hello,
I am new to Jira automation and have a problem to make an automation that update a task due date if the sub-task created is a furthest date, here is a screenshot of my automation ( I work on Jira version 9.12.10
And here is the audit log :
my current "Edit issue" is : "{{triggerIssue.customfield_12602}}" The problem is that this does only update the date based on the last subtask created. I tried with this :
{{lookupIssues.max(issue.customfield_12602)}} but it makes the due date field disappear. I am quite lost at what I should try next. Can someone help me please ?
Hi @vince margaria , Welcome to the Atlassian Community.
First step: Your trigger is quite wide, it allows the automation to run on epics, stories and sub-tasks. Each of these issuetypes would require a different approach, if I read your problem correctly:
So these two cases might seem similar, the triggerIssue type is different, which requires prudence when you use the {{triggerIssue}} variable to navigate to the correct issues that need to be evaluated / changed.
Normally the trigger is accompanied by a selection statement like: if issuetype = sub-task. This would allow you to make two if-blocks dealing with the two approaches explained above in one automation, one for the sub-task triggering, one for the story triggering the automation.
Second step in your automation journey would be to get valuable log entries, as currently there are no values (requested issues) reported in your log. With the distinction above implemented, you should get better log values.
One thing to know: after the for Parent branch, you should lookupIssues using issue, not the original triggerIssue (as that would be the sub-task triggering the automation)
Let's revisit after you changed the above,
Dick
Meanwhile, I did a search and found a very nice way to get the maximum due date of a list of due dates. @Trudy Claspill was so kind to provide an answer that used this here;
Parent-issues-have-to-inherit-the-latest-due-date-of-child
It is not a complete answer to your question, but its potential to help find the value that should be used to update the story due date is there.
Three cheers for Trudy!
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dick,
I did a complete 180 and changed they way I do my automation to something like this :
This new method compare everytime there is a change in a children with the parent, if the child is greater, the parent take the change. This does not affect Epic or other issue type since I am using a custom field that is only in "Tasks" and "Story".
Here is my log. This seems to work well but I'm curious if you think the same as this is my first automation. If anything is badly translated sorry i'm non-native english
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries, I'm non-native as well (vous-êtes Francophone?)
:)
Your automation takes care of occurrence number 1: A sub-task is edited.
I think it is also necessary to do the calculation if the parent (story) is changed. It could very well be the case that the due date of the story is set to a different date. Then your should re-assess the due dates of the children of that story and perhaps even adjust the due date of the story. (that's occurrence number 2).
You still need to distinguish between these two different parts of the automation by checking the issuetype of the triggerIssue and switch to the appropriate part of the automation.
Thanks for your enthusiasm,
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Dick
Je suis en effet Francophone^^.
Thanks for the advices I will add theses as soon as I can, for now I will try to get some free time to learn correctly Automation, this tool is truly powerful but I don't really grasp what I'm doing at the moment. Once I get the opportunity I will update this post as well for the future admin asked to do this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As your automation is only capable of processing changes in subtasks being modified, you really should put a condition between trigger (green circle) and first action (blue circle):
if issuetype = subtask
Happy automating,
Dick
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.
Hi @vince margaria -- Welcome to the Atlassian Community!
The solution approach you tried with Lookup Issues will not work for Jira Data Center as the lookup results do not include all issue fields. Here is the suggestion to improve that: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877
The workaround for that in your scenario is to remove the Lookup Issues action and instead use the Send Web Request action to call the REST API endpoint for an issue search with JQL. Then use the web response smart value to find the maximum Due Date value.
Also, only checking when a subtask's Due Date field changes ignores several possible scenarios:
Many of these could require additional rules, with different triggers and logic, although some of them may be combined. The key is: how accurate do you want the parent's Due Date to be?
Kind regards,
Bill
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 ,
In a perfect world I would like this automation to be perfect but unfortunatly i am hurried by time and principaly need an automation that work on creation / modification of children due date to the parent. I stopped using Lookup since I could not make it work, knowing that it comes from the fact I'm working on Data Center reassure me that I am not crazy.
You are correct about the fact that I need to adds error gestion to handle all differents scenarios.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to try the REST API approach, here are some references to help set that up:
How-to article for calling using the Send Web Request action:
REST API endpoint to search for issues with JQL:
https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/search-search
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.