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

Need help in formula for max date

Tehmina Aslam July 8, 2024

Hi,

I have structure where all the tickets are grouped by assignee: I want to check when the resource is free

  • I want to get the maximum date from the ticket assigned to the resource 
  • if the maximum date is not passed, then it shows that the resource is free by x days 

 

  • if the maximum date is passed yesterday, then it shows that the resource is free today

 

  • if the maximum date is passed already, then it shows that the resource is free since x days 
WITH maxDueDate = MAX(dueDate) 
WITH currentDate = NOW()
WITH daysDifference = ROUND((currentDate - maxDueDate) / (1000 * 60 * 60 * 24))

WITH availabilityStatus = 
    IF (currentDate > maxDueDate) :
        "Free since " + daysDifference + " days"
    ELSE IF (currentDate == maxDueDate + 1 day) :
        "Free today"
    ELSE :
        "Free in " + (maxDueDate - currentDate) / (1000 * 60 * 60 * 24) + " days"

Thank in advance

 

1 comment

Comment

Log in or Sign up to comment
Stepan Kholodov _Tempo_
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

Hello @Tehmina Aslam 

If you want to return complex values of a text combined with calculated numeric values, you can use the concat() function for it. It can be done by replacing:

"Free since " + daysDifference + " days"

with

concat("Free since ", daysDifference, " days")

I hope this helps! If you need further assistance or if you have more questions about Structure, please reach out to us directly at our support portal and we'll get back to you shortly.

Best regards,
Stepan
Tempo (the Structure app vendor)

TAGS
AUG Leaders

Atlassian Community Events