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
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}}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And I just used your suggestion to sort using JQL and it worked like a charm, Thank you so much for your help!
Valerie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.