Hi,
I want to use a Json code in Jira Automation in the additional field section in wich I want to update the due Date of an issue with a customfield (date picker).
At first I implemented this and this works but only when the customfield_10015 is not empty.
{
"fields": {
"duedate": "{{issue.customfield_10015}}"
}
}But what I want is that the duedate is set to "None"/ Empty" when the customfield_10015 is also empty. But Json needs always a value.
So I tried this:
{
"fields": {
{{#if(not(triggerissue.customfield_10015.isEmpty))}} "duedate":"{{issue.customfield_10015}}"{{/}}
}
}But I get an error in the automation.
UPDATE:
When I try this and the customfield is not empty the automation works and the duedate gets the same value like the customfield_10015.
But when the customfield_10015 is Empty/ does not exists the Automation does not work and I get an error.
{
"fields": {
{{#if(not(exists(issue.customfield_10015)))}} "duedate": null
{{/}} "duedate": "{{issue.customfield_10015}}"
}
}