Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,467
Community Members
 
Community Events
184
Community Groups

I would like to create an auotmation that when an activity is delayed then the linked activity (link types: blocks) delays by the same time interval. However, the automation does not read the variables inside a date sum or difference operation. Is there any error in the code? 

Automation.png

 

End date.pngLeadTime.png

Issue.customfield_10015 is the field of start date.Duedate.pngStart date.png

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 04, 2023

Hello @Andrea Ferraris 

Welcome to the Atlassian community.

I recommend that you start by using the Log Action to print out your variables and your calculated values into the Audit Log to ensure you are getting the values that you expect.

Can you show us the Audit Log for the rule execution?

audit log 1.pnglog action.png

The variable LeadTime is empty, therefore DueDate remains the same as before and does not add with LeadTime.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 05, 2023

You are creating the variable LeadTime from

{{issue.customfield_10015.diff(EndDate).days}}

That suggests there is something wrong with that smart value that you are trying to assign to the LeadTime variable.

I see that EndDate is also a variable that is set from DueDate.

The issue is that content saved to a variable is Text. Your variables are not being recognized as Dates.

To use them in date functions and have them treated as dates you need to convert the text to dates.

{{issue.customfield_10015.diff(EndDate.toDate).days}}

Like Andrea Ferraris likes this

Now the LeadTime calculation is correct but the automation does not perform the sum on the duedate.

I used this formula: {{issue.duedate.plusDays(LeadTime)}}

Is there any error?

Thank You!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 06, 2023

This problem is similar to the first.

LeadTime is a variable you constructed.

Variables are stored as strings/text.

Jira doesn't automatically recognize text that is numbers as a number.

You need to convert the text string to a number  to use it as a number.

{{issue.duedate.plusDays(LeadTime.asNumber)}}

Like Andrea Ferraris likes this

Now all it's perfect. Thank you very much!

Like Trudy Claspill likes this

Suggest an answer

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

Atlassian Community Events