Forums

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

having trouble using list.max with custom field of date type

Valerie Bevill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2025

I am trying to set a custom field called Target end of type date based on the Target end date of the issue's children.

The only issue I'm having is that I can't seem to get the list.max function to return something that can be store in the Target end field.  I can use the list.first function and it works great.  I have also set the Target end field using the due date field value with success.

I must be blind to something here.  To sum:

{{lookupIssues.customfield_10591}} gives me the list of Target end dates

{{lookupIssues.customfield_10591.first}} gives me the first Target end date.

{{lookupIssues.customfield_10591.max}} throws an error that the field must contain a value that looks like "yyyy-MM-dd".  When I try to print it into an email, I get a blank value.

Truly appreciate any insights you may have!

Valerie

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
July 15, 2025

Hello @Valerie Bevill 

Welcome to the Atlassian community.

To enable us to help you please provide a screen image showing your entire automation rule.

An alternative to using max would be to and an ORDER BY clause in the JQL used by your Lookup Issues action, ordering the results by customfield_10591 in descending order, and then use 

{{lookupIssues.first.customfield_10591}}

Trudy Claspill
Community Champion
July 15, 2025

Does your Lookup Issues results list include issues that have no value in the Target end date field? That could be what is causing your problem.

Valerie Bevill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 16, 2025

Hi, there, thank you.  The results list doesn't have any blanks thus far.  I'll have to keep that in mind going forward.  

Here is a screenshot of the rule as it was working with the first selection.  I was hoping to be able to set it with max, as I mentioned.

Screenshot 2025-07-16 151947.png

Valerie Bevill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 16, 2025

And I just used your suggestion to sort using JQL and it worked like a charm,  Thank you so much for your help!

Valerie

Like Trudy Claspill likes this
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.
July 15, 2025

Hi @Valerie Bevill -- Welcome to the Atlassian Community!

Is that the built-in Target End field?

If so, I believe that is provided to rules as a text representation of the date, and so the list max function cannot operate on it until the text is converted to a date.  For example, please try this:

{{lookupIssues.customfield_10591.toDate.max}}

 

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events