Hi everyone,
I am trying to add a customfield ("Target start", of type date) to a subtask which should be calculated based on the Parent issue "Target start".
So...let's say:
Task A -> "Target start" = 24/04/2023 [ THIS IS THE INFORMATION I HAVE ALREADY ]
Subtask a -> "Target start" = Task A "Target start" - 3 weeks [ THIS IS WHAT I NEED ]
I created an automation as I have multiple Tasks and therefore multiple Subtasks that require this adjustments.
The automation runs smoothly but I am having trouble in parsing the Parent date into the subtask.
I am not sure how should I complete the json part to complete this properly. Can someone suggest me other ways?
Thanks!
When you need to do actions in different tasks, related, child and parents, you must use the Branch rules.
So you will have options to do all the actions you need.
As far as I understood you are not using branch yet
You can find more information here https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/
If you already using branch, as @Trudy Claspill mentioned, would be great having the screenshot for the whole rule, so we can help you.
https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/
Hi @Patricia Francezi !
I am using branches already, I guess.
This is the error I get in the audit log about the parsing of the dates:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Mateo Colombo
Welcome to the Atlassian community!
Whenever requesting help with an Automation Rule, please show us the entire rule. Edit Issue actions and references to the issue object in smart values rely heavily on the context. Without seeing the entire rule we can't determine the context for this one action to offer you the proper advice.
Is you rule not working as you have written it? How exactly is it not meeting your expectations? What is shown in the rule's Audit Log when the rule executes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply! I already added everything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should not have to use Advanced Editing for this.
Are you able to select the Target Start field directly from the available fields in the Edit action?
Once you pick the field you can enter the smart value you want to use to set it.
I do wonder, though, why you are setting the target start date of a subtask to be 3 weeks before the target start date of its parent task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe Target Start, and some other advanced roadmap fields, cannot be selected from the Edit Issue dropdown list yet. Instead only JSON edit works for them. Here is the suggestion to fix that: https://jira.atlassian.com/browse/JIRAAUTOSERVER-159
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.
Hi @Bill Sheboy ,
Thanks you for your comment! I managed to get the json through with no errors BUT not entirely as I need it to.
I managed to pass to the subtask only the same date as the Parent (Task) with this json code:
{
"fields": {
"Target start":"{{triggerIssue.Target start}}"
}
}
Now, what I really need is to add or subtract dates to the target start date of the Parent.
When I try to do so:
{
"fields": {
"Target start":"{{triggerIssue.Target start.plusDays(21)}}"
}
}
I get the following error:
Edit issue
Error editing issues
Ticket-ABC (Unparseable date: "" (customfield_11800))
Do you have any suggestion on how to do so?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finally manage to do it!
I had to convert the date into a date type using toDate (which apparently was the error) and then add the days:
{
"fields": {
"Target start":"{{triggerIssue.Target start.toDate.minusDays(21)}}"
}
}
Now I am getting the results expected!
Thanks everyone for the help!
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.