trying to set the date between two options to the minimum

Una Horne February 5, 2025

basically, i have a task that needs to (once autopopulated) set the due date to either tuesday or friday depending on which one is closer. i have no issues with making it populate to tuesday OR friday with {{now.withNextDayOfWeek("XXX")}}, but i know there is a function that can be used "min" to make it decide which one to assign it to. is there any solution to this? ive tried:

{{MIN(now.withNextDayOfWeek("TUE"), now.withNextDayOfWeek("FRI"))}}{{(now.withNextDayOfWeek("TUE"), now.withNextDayOfWeek("FRI"))MIN}}{{now.withNextDayOfWeek("TUE"),("FRI").min}}

1 answer

0 votes
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, 2025

Hi @Una Horne 

Your syntax is not correct for using the min function...

The min function may be used with the long, format of a math expression or with a list of values (either numbers or dates / times).

 

One way to solve what you asked is to create a list of dates to use the min function:

{{now.withNextDayOfWeek("TUE").jiraDate.concat(",").concat(now.withNextDayOfWeek("FRI").jiraDate).split(",").toDate.min}}

How that works:

 

Kind regard,
Bill

Suggest an answer

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

Atlassian Community Events