automation for date difference

Іван Андрєєв April 27, 2023

I have an automation to calculate the difference between Due date and Start date, the audit shows that it works, but the Feedback is not filled. What could be the problem?

Снимок экрана 2023-04-27 в 12.04.37.pngСнимок экрана 2023-04-27 в 12.04.50.pngСнимок экрана 2023-04-27 в 12.04.58.png

2 answers

1 accepted

0 votes
Answer accepted
Manisha
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.
April 27, 2023

Hi @Іван Андрєєв 

As per the screenshot, both start date and due date are same 24Apr 2023. This could be the reason.

 

Thanks,

Manisha

Іван Андрєєв April 27, 2023

@Manisha in other project I have 0 in result.

0 votes
John Funk
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 27, 2023

Hi @Іван Андрєєв 

Can you share a screenshot of the audit log? 

Іван Андрєєв April 27, 2023

@John Funk  Hi

Снимок экрана 2023-04-27 в 12.45.00.png

John Funk
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 27, 2023

What type of field is Feedback? Number? Text?

Іван Андрєєв April 27, 2023

Text Field (single line)

Like ichrak.djebrit likes this
John Funk
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 27, 2023

use {{issue.Due date.diff(issue.Start date).days}}

Smart values are case sensitive and the field name has to be exactly the same. 

Like ichrak.djebrit likes this
Іван Андрєєв May 9, 2023

@John Funk 

there are problems with the calculation, the field is not filled

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2023

So you copied my code above and it still does not update the field? 

If so, sub out now() for one of the dates and see if that works. 

Іван Андрєєв May 10, 2023

two different field formats, changed different dates, but even so it turns out that the audit log says "success", but the field is not filled, maybe the problem is in the format of the fields where the dates are placed?Снимок экрана 2023-05-10 в 11.40.55.png

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

My apologies for not being clearer. I meant try this:

 {{now.diff(issue.Start date).days}} and see if it populates anything. Or

 {{now.diff(issue.Due date).days}}

Іван Андрєєв May 10, 2023

sorry for my misunderstanding, it turns out that the rule did not work with the "Due date" option, what is the problem then?

Снимок экрана 2023-05-10 в 12.20.57.pngСнимок экрана 2023-05-10 в 12.24.39.png

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Atlassian's example uses {{issue.duedate.

Try that format again with the now option and see if that works. 

And if so, try to string them together again. 

Like ichrak.djebrit likes this
Іван Андрєєв May 10, 2023

that's how it works, thank you very much.
{{issue.Start date.diff(issue.duedate).days}} - with this expression, it outputs non-negative numbers, if on the contrary, it counts minus, for example -2. Shouldn't it be the other way around?

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Not if your Start date was two days before your Due date. Which I would hope it is.  :-)

Іван Андрєєв May 11, 2023

understood, thanks for your help, the issue is resolved.

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2023

Great!

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