Hi,
I've got a parent task and a bunch of sub tasks. The parent task has a custom field 'Open Date'. This is set at the parent and an automation sets the same value through all sub tasks.
I have added a custom field to the sub tasks, it is called 'Offest', the value can be -10, 0, 1, 2 or 2+
For each Offset value, I want to set the due date, kind of like this:
WHEN Offset is 0 THEN {{issue.parent.Open Date}}
WHEN Offset = 1 THEN {{issue.created.plusBusinessDays(20)}}
WHEN Offset = 2 THEN {{issue.created.plusBusinessDays(50)}}
ELSE {{issue.parent.Open Date.minusDays(issue.Offest)}}
I couldn't get nested if / else to occur after branch level, and created a condition for each.
See screenshot of rule, its seems convoluted.
I simplified it in the end, using the custom field ID's ending up with a successful run.
The simplification was introducing another offest, for only two conditions.
This worked WHERE either offset is empty, I replaced the custom field names with their ID's
{{triggerIssue.parent.Open Date.minusDays(issue.OpenOffset)}}
{{triggerissue.created.plusDays(issue.StartOffest)}}
Hi @Jeff Xanthos and welcome to the Community!
Have you considered filling out the exact number of days you would like to add as your offset field on the subtasks, trying to use the same calculation once for all your subtasks, making it dynamic?
issue.created.plusBusinessDays({{Offset}})
If you somehow feel you need to use conditions, you may also consider defining a lookup table that helps you translate the conditional values into the number of days you want to add, thus creating more or less the same effect: based on your logic, you figure out the number of days you need to add to your calculation and then execute it once with the dynamically retrieved number of days.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Walter
{{issue.parent.Open Date}} can change through out the course of the project. So we have a number of sub tasks that are due on {{issue.parent.Open Date}}, others due X days after {{issue.parent.created}} and others are due X days before {{issue.parent.Open Date}}.
I haven't explored lookup tables yet I'll take a look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jeff Xanthos ,
What issue did you run into with if/else? I also wonder if you could simply express the offset as the number of days rather than having to 'decode' thus. That is use "-10", "20", etc. that would simply your rule by eliminating the if/else condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jack Brickey
No if / else technically, that condition cant be loaded it seems after introducing the sub task branch, I did see you could use JQL at branch level to get around that but continue with multiple if's just to see if I could get the logic conditions working first.
Expressing the offset as the number of days I have done, but I am multi purposing the use of that field ( SQL case statements are something Im used to working with) to come up:
WHEN Offset is 0 THEN {{issue.parent.Open Date}}
WHEN Offset = 1 THEN {{issue.created.plusBusinessDays(20)}}
WHEN Offset = 2 THEN {{issue.created.plusBusinessDays(50)}}
ELSE {{issue.parent.Open Date.minusDays(issue.Offest)}}
Maybe creating a custom field (offset) for both the OpenDate and CreatedDate is the way to go.
Here's the list of subtasks and the respective columns, only the first condition Offset is 0 THEN {{issue.parent.Open Date}} worked.
And this is the audit log result
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.
Register today!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.