Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Rule: date change for sequential issues

Andrea Kargodorian October 17, 2022

Hi everyone, 

 

I've read many different answers on here but am still unable to get this automation rule to work. There are sequential issues within an epic. They are all linked to the epic. When the due date of an issues changes but a certain amount of time (e.g. 5 days, I would like to automatically change the other sequential issues by the same amount of time. 

I keep getting an error message in the audit log (The duedate must be of the format "yyyy-MM-dd" (duedate)). I have gone to System - Look and feel and changed date format but this hasn't helped. 

What do I need to do to the date format and how do I fix it? 

Automation Rule.JPGError Message.JPG

 

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
October 17, 2022

 Hello @Andrea Kargodorian 

Welcome to the community.

In cases like this I find it useful to use the Log Action component to check what values I'm getting. So, I created a rule to be triggered like yours on a change to the Due Date field. Then I used Log Actions to check the value before the change, after the change, and the value that you are trying to use to set the Due Date in other issues.

Screen Shot 2022-10-17 at 5.24.31 PM.png

 

In your rule, what you have written is attempt to set the Due Date field to the difference between the original and new values of the Due Date in the trigger issue. What you need to do is set the Due Date to the new date when that difference is applied. 

I'm still working out how to do that myself.

Trudy Claspill
Community Champion
October 17, 2022

Got it!

I opted to save the days of the date difference as a variable, before the For component.

Screen Shot 2022-10-17 at 6.05.28 PM.png

Then in the For branch I use that variable to update the Due Date of the issue I want to change.

Screen Shot 2022-10-17 at 6.06.24 PM.png

This is the whole rule...

Screen Shot 2022-10-17 at 6.09.18 PM.png

 

You might want to add some extra checks to your rule to check if the date that was changed was originally blank, or if the date in the sibling issue that you want to change is blank. Those could cause problems with the .Diff and .plusDays functions.

 

Thanks to @Stefan Salzl 's response on this post for helping me figure it out.

Like Stefan Salzl likes this
Andrea Kargodorian October 17, 2022

Thank you thank you thank you!! This worked perfectly! 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2022

Hi @Andrea Kargodorian -- Welcome to the Atlassian Community!

With a rule of this type, which branches to any issues with the same parent epic using JQL...Have you confirmed that the date of the trigger issue is not also changing?

If it is, you may want to modify the branch to exclude the trigger issue from the results.

Kind regards,
Bill

Andrea Kargodorian October 20, 2022

Hi @Trudy Claspill 

How do I then make this rule also apply to the start date? i.e. the amount of change in the due date of the trigger issue is applied to both the due date and start date of related issues? 

 

Thanks heaps - i've tried a few things and am not getting anywhere. The version below makes the start date go empty - but I thought this would be applying the 'amount of difference' = dueDateDiff to the start date of issues? 

DueandStartdate.JPG

Trudy Claspill
Community Champion
October 21, 2022

Hello @Andrea Kargodorian 

To debug this I would encourage you to add Log Action actions before the Edit action to check the value of the Start Date field before you change it and print out the value you plan to assign to the field. Then show us the Audit Log.

Andrea Kargodorian October 24, 2022

Hi @Trudy Claspill 

I appreciate the response but I am very beginner and am really looking for some extra hand holding to work through this issue. Are you able to provide the code on how to do this? or point me in the direction with someone who can help fix this issue? 

Many thanks, 

Andrea

Trudy Claspill
Community Champion
October 24, 2022

At any point in your Automatin Rule you can add an Action called Log Action.

Screen Shot 2022-10-24 at 4.29.06 PM.png

 

With that action you can log information to the Audit Log for the rule. You can add specific text and/or smart values.

Screen Shot 2022-10-24 at 4.30.07 PM.png

 

Screen Shot 2022-10-24 at 4.31.32 PM.png

 

You can use that to look at the values that you are using in comparisons in your Rule, and values that you want to assign to the fields, to make sure that the actual values are what you expect.

I recommend that you insert a couple of Log Action actions before your "Then: Edit issue fields" component. Use those to log the current value for {{issue.startdate}} and the value that you are trying to assign to the field.

Screen Shot 2022-10-24 at 4.35.00 PM.png

 

That will help you make sure you have a valid value in "Start date" to begin with, and will show you the value you are trying to assign to that field.

Run your rule again and then check the Audit Log to see what the output is. 

Report back to us showing the output sent to the Audit Log.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events