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

Automation Jira

Andrea Ferraris April 4, 2023

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.png LeadTime.png

Issue.customfield_10015 is the field of start date.Duedate.png Start 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.
April 4, 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?

Andrea Ferraris April 4, 2023 edited

audit log 1.png log 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.
April 5, 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
Andrea Ferraris April 5, 2023

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.
April 6, 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
Andrea Ferraris April 6, 2023 edited

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

Like • Trudy Claspill likes this
jirasak rattanawijit
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 8, 2023

Yes

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events