Forums

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

Formula error to manipulate arrays to strike all past due dates and show the latest one

Rajal Shah
Contributor
April 29, 2025

Screenshot 2025-04-29 at 11.00.49 AM.png

 

I am getting all historical values of due date and putting a strikethrough of all past due dates except the latest one.

 

e.g. for myArray = None -> 2025-04-11 00:00:00.0,

                                2025-04-11 00:00:00.0 -> 2025-04-25 00:00:00.0,

                                2025-04-25 00:00:00.0 -> 2025-06-30 00:00:00.0

 

The output is: 

Screenshot 2025-04-29 at 11.02.33 AM.png

 

However, this formula fails for this myArray and I am unable to debug why that is the case. (Someone is setting and unsetting the value of 5/15/2025..)

myArray = None -> 2025-05-15 00:00:00.0,

                   2025-05-15 00:00:00.0 -> None,

                   None -> 2025-05-15 00:00:00.0

 

The output I get is Screenshot 2025-04-29 at 11.06.39 AM.png

 

 

Here is the code..

WITH myArray = unique( history ) :
// WITH myArray = history.changes.filter($.field = "duedate") :

WITH formattedArray = MAP(myArray,
IF(
$.to = LAST(myArray).to,
$.to,
CONCAT("~~ ", $.to, " ~~")
)
) :

//myArray
//formattedArray
JOIN(formattedArray, ", ", "", "")

 

 

Can anyone explain what is going on?

 

0 answers

Suggest an answer

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

Atlassian Community Events