Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you might find the site temporarily inaccessible. Thanks for your patience. Read more.

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

[JMWE] Automation to fill day count

RIZKY JTUASIKAL
Contributor
September 24, 2024

I have a custom field :

"Latest Plan Live." (date field)

 

I am implementing automation to fill in my "Days to fill" field with the number of days.

For example:

Latest Plan Live = March 1

Current Date (calendar date) = March 30

Days to fill should show 30 (?)

 

I have this formula, but got an error message:
date.PNG

 

 How do I need to update this formula to produce the correct count of calendar days?

1 answer

1 accepted

2 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 24, 2024

Hi @RIZKY JTUASIKAL 

Try this:

{{ now | date('diff', issue.fields["Latest Plan Live"], 'days') + 1 }}

See  https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466323491/date+filter#diff for details

RIZKY JTUASIKAL
Contributor
September 24, 2024

Hii @David Fischer ,

Thanks in advance for answering my question..

But I want to ask again,
when I did the first test with the following dates:

Current day = September 25, 2024
Latest Plan Live = September 20, 2024


pass.PNG

I get the result 6.

day.PNG




Then I did the 2nd test, where the data is as follows:

Current day = September 25, 2024
Latest Plan Live = September 30, 2024

I get the result -3.

error.PNG
But shouldn't the result be -6? 

days.PNG

CMIIW


Once again, thank you very much for your help @David Fischer 

RIZKY JTUASIKAL
Contributor
September 24, 2024

Hi @David Fischer ,

 

I found an alternative query, and maybe we can use it.

bd.PNG

with the following dates:

Current day = September 25, 2024
Latest Plan Live = September 30, 2024

But I would still like to know the answer to the question I asked earlier

 

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2024

Hi @RIZKY JTUASIKAL 

You should actually remove the "+1" from my previous snippet. 

As for using businessDiff, it's different since it only counts business days, but sure, you can use it instead of "diff" in my previous snippet. 

Like RIZKY JTUASIKAL likes this
RIZKY JTUASIKAL
Contributor
September 25, 2024

Hi @David Fischer ,

 

Well, thanks for the answer, David.
I really appreciate it.

God bless you :)

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