Hey guys,
We are currently implementing an ISO 27001:2022 ISMS in JIRA + Confluence. We only have one issue left that has to do with automation in JIRA, but for the love of me i can't figure out how to fix it. I've looked at the documentation and asked chatgpt but i cannot find the answer. Maybe someone here can?
I have two custom fields in my ISO 27001 issues, one is named "Due Date (ISO)" and the other is named "Check Frequency (ISO)". If an issue that has both these values filled in gets closed or resolved, i want a new issue cloned and the "Due Date (ISO)" set to a new date (e.g. a month, quarter, year, etc later).
So for example, Due Date (ISO) is 31/12/2024. Check Frequency (ISO) is 'Yearly'. I want the cloned issue to be the same issue but the Due Date (ISO) should be set to 31/12/2025.
The conditions (fields not empty) work and the automation clones the issue just fine, but the Due Date (ISO) is emptied. What am i doing wrong?
You can find the screenshot and then the code underneath the screenshot. In the 'fields to set' pulldown, only "Due Date (ISO)" is selected.
Thanks in advance!

{{if(equals(issue.Check Frequency (ISO), "Monthly"), issue.Due Date (ISO).plusMonths(1), if(equals(issue.Check Frequency (ISO), "Quarterly"), issue.Due Date (ISO).plusMonths(3), if(equals(issue.Check Frequency (ISO), "Yearly"), issue.Due Date (ISO).plusMonths(12), if(equals(issue.Check Frequency (ISO), "Two-yearly"), issue.Due Date (ISO).plusMonths(24), if(equals(issue.Check Frequency (ISO), "Three-yearly"), issue.Due Date (ISO).plusMonths(36))))))}}