Forums

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

Last Business Day

Melissa C
Contributor
February 5, 2024

Help!

I thought this was going to be an easy one!

I run a report via automation on Monday morning, I want the date in the subject to be the Friday before date. 

Now = February 5, 2024

{{now.toBusinessDayBackwards}} = 2024-02-05T15:11:25.7-0500

{{now.toBusinessDayBackwards.LongDate}} = February 5, 2024

The date should be February 2, 2024

2 answers

2 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
February 5, 2024
Melissa C
Contributor
February 7, 2024

@Kal 

Thank you I added "longdate" and that worked 
{{now.minusBusinessDays(1).longDate}} = February 2, 2024

Like Kalyan Sattaluri likes this
0 votes
Answer accepted
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.
February 5, 2024

Hi @Melissa C 

I am using Jira Cloud, not Server, so please try this with your version:

{{now.withNextDayOfWeek("FRI").minusDays(7)}}

It is clunky but works...subject to time zone stuff and when you run the rule.

Kind regards,
Bill

Melissa C
Contributor
February 5, 2024

@Bill Sheboy @Kalyan Sattaluri 

Almost!  I got this 

 {{now.withNextDayOfWeek("FRI").minusDays(7)}} = 2024-02-02T16:04:17.5-0500

 

But I added "longDate" and that worked 

{{now.withNextDayOfWeek("FRI").minusDays(7).longDate}} = February 2, 2024

 

@Kal 

Thank you I added "longdate" and that worked 
{{now.minusBusinessDays(1).longDate}} = February 2, 2024

Like Bill Sheboy likes this
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.
February 5, 2024

Well done! 

All of those format modifiers return the date (or date / time) formatted as text.  When you need to keep the value as a date (such as to set to another date field) leave the format off.

Suggest an answer

Log in or Sign up to answer