I'm trying to get my head around json and failing miserably.
I have a custom field which is a drop-down list, that contains the values 0-36 & "> 3 years"
I want to run an automation comparing today's date with the date in another field and update the field with the calculated value.
customfield_12047 is the field holding the date to compare to.
customfield_12095 is the field I need to set 'Months open after agreed remediation date'.
It's easy enough with the gui to have the if "{{issue.customfield_12047.diff(now).months}} is greater than 36" then set the field value to ">3 years"
Less than 37 requires the JSON. This is as close as I've got but I'm obviously doing something fundamentally wrong.
{ "fields": { "customfield_12095": "customfield_12047.diff(now).months" } }When run, the audit trail throws the error
Specify a valid 'id' or 'name' for Months open after agreed remediation date (customfield_12095))
Tips, tricks, pointers gratefully received (and yes, I think I have the logic right to cope with less than zero
)
tks