In Automation, I want to find the earliest date from a list of dates and use it to populate another field within the same issue.
For example, in my issue, I may have a list of dates like:
- Custom Field 1: May 10
- Custom Field 2: April 5
- Custom Field 3: June 1
I want to look at all those dates and pick the one that comes first — April 5 — and set another field using that date.
My list of fields are:
- Custom Fields:
- issue.customfield_10652
- issue.customfield_10713
- issue.customfield_10659
- issue.customfield_10677
- issue.customfield_10683
- issue.customfield_10689
- issue.customfield_10701
- issue.customfield_10695
- issue.customfield_10707
- issue.customfield_10671
- issue.customfield_10557
- All Date Picker fields
- Field to insert the earliest date to:
- issue.customfield_10015
- Date Picker field
The output of field is "customfield_10652":"2025-04-25".
I have tried the following (with a reduced number of fields):
--------------
Create Variable
Variable Name = TestVariable
Smart Value = {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min}}
Unable to render smart values when executing this rule:
Failed to get value for [issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min: {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min}}
It should show "25 Apr 2025".
--------------
Log Action
Log message = {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min}}
Unable to render smart values when executing this rule:
Failed to get value for [issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min: Earliest Date: {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min}}
It should show "25 Apr 2025".
--------------
Edit work item
Field = Start date
Value = {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min}}
Error - Unable to render smart values when executing this rule:
Failed to get value for [issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min: {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].min}}
It should show "25 Apr 2025".
--------------
Create Variable
Variable Name = TestVariable
Smart value = {{[issue.customfield_10652.jiraDateTime, issue.customfield_10713.jiraDateTime, issue.customfield_10659.jiraDateTime].min}}
Unable to render smart values when executing this rule:
Failed to get value for [issue.customfield_10652.jiraDateTime, issue.customfield_10713.jiraDateTime, issue.customfield_10659.jiraDateTime].min: {{[issue.customfield_10652.jiraDateTime, issue.customfield_10713.jiraDateTime, issue.customfield_10659.jiraDateTime].min}}
It should show "25 Apr 2025".
--------------
Edit work item
Field = Start date
Value = {{[issue.customfield_10652.jiraDateTime, issue.customfield_10713.jiraDateTime, issue.customfield_10659.jiraDateTime].min}}
Error - Unable to render smart values when executing this rule:
Failed to get value for [issue.customfield_10652.jiraDateTime, issue.customfield_10713.jiraDateTime, issue.customfield_10659.jiraDateTime].min: {{[issue.customfield_10652.jiraDateTime, issue.customfield_10713.jiraDateTime, issue.customfield_10659.jiraDateTime].min}}
It should show "25 Apr 2025".
--------------
Create Variable
Variable Name = TestVariable
Smart Value = {{#=}}min({{issue.customfield_10652}}, {{issue.customfield_10713}}, {{issue.customfield_10659}}){{/}}
Log = "TestVariable: 1995"
It should show "25 Apr 2025".
--------------
Create Variable
Variable Name = TestVariable
Smart Value = {{#=}}min({{issue.customfield_10652.jiraDate}}, {{issue.customfield_10713.jiraDate}}, {{issue.customfield_10659.jiraDate}}){{/}}
Log = "TestVariable: 1994"
It should show "25 Apr 2025".
--------------
Create Variable
Variable Name = TestVariable
Smart Value = {{#=}}min({{issue.customfield_10652.jiraDateTime}}, {{issue.customfield_10713.jiraDateTime}}, {{issue.customfield_10659.jiraDateTime}}){{/}}
Error - Unable to render smart values when executing this rule:
Unknown operator : at character position 18: min(2025-04-26T00:00:00.0+0000, 2025-04-25T00:00:00.0+0000, 2025-04-25T00:00:00.0+0000)
It should show "25 Apr 2025".
--------------
Create Variable
Variable Name = TestVariable
Smart Value = {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].filter(notNull).min}}
Error - Unable to render smart values when executing this rule:
Failed to get value for [issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].filter(notNull).min: {{[issue.customfield_10652, issue.customfield_10713, issue.customfield_10659].filter(notNull).min}}
It should show "25 Apr 2025".
--------------
Edit work item
Advanced fields =
{
"fields": {
"customfield_10015": "{{issue.customfield_10652.jiraDate.min(issue.customfield_10713.jiraDate).min(issue.customfield_10659.jiraDate)}}"
}
}
Error - Error editing work items
PMOV2-476 (The Start date must be of the format "yyyy-MM-dd" (customfield_10015))
It should show "25 Apr 2025".
--------------
Edit work item
Advanced fields =
{
"fields": {
"customfield_10015": "{{issue.customfield_10652.jiraDate.min(issue.customfield_10713.jiraDate).min(issue.customfield_10659.jiraDate).toString(\"yyyy-MM-dd\")}}"
}
}
Error - Error editing work items
PMOV2-476 (The Start date must be of the format "yyyy-MM-dd" (customfield_10015))
It should show "25 Apr 2025".
--------------
Edit work item
Advanced fields =
{
"fields": {
"customfield_10015": "{{issue.customfield_10652.min(issue.customfield_10713).min(issue.customfield_10659).toString(\"yyyy-MM-dd\")}}"
}
}
Error - Error editing work items
PMOV2-476 (The Start date must be of the format "yyyy-MM-dd" (customfield_10015))
It should show "25 Apr 2025".