Hi,
I am trying to modify the value of a date custom field using smart values for a Jira Automation, according to this documentation: Jira smart values - date and time | Cloud automation Cloud | Atlassian Support.
I have printed out log messages to troubleshoot, and the issue appears to come from the fact that I am using a custom field (date), as .plusDays(14) works for the native "created" field. The Edit Issue action follows:
{
"fields": { "customfield_10022": "{{ issue.customfield_10022.plusDays(14) }}"}
}
customfield_10022 is "Target start"
What am I missing here?
Hi @Tom Yan -- Welcome to the Atlassian Community!
There are some extra spaces in your smart value expressions, so please try removing those.
And if that does not work...I have seen this symptom in other posts, where a date field in rules is somehow returned as text.
Please try adding toDate for a conversion before trying the increment, like this:
{
"fields": {
"customfield_10022" : "{{issue.customfield_10022.toDate.plusDays(14).jiraDate}}"
}
}
Kind regards,
Bill
@Bill Sheboy, great tip on the ".toDate". I just tried that out and it worked well. I thought I had tried that, but I must have done something wrong previously!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tom Yan
Just following up to check if this solved your question or if there is more to do. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could raise a ticket with Atlassian.. I cannot get any functions to work on the custom field of type "date".
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.