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))))))}}
A field value set on using smart values can only contain a value, based on the smart value.
You can't use IF/ELSE statements in setting a field value.
That's where you need the IF/ELSE condition in the rule
I would suggest breaking this out into the Automation Actions for "IF/ELSE", it makes it much easier to read and maintain.
This IF/ELSE assumes you've already created the issue, and is now modifying the due dates accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jovin, not to sound ungrateful but this was exactly what i was trying when you replied to my post - so i'm happy to hear you confirm this is a better idea. Thank you for your efforts. Sadly i did wish to understand why the code doesn't work, but there are just not enough resources on this to understand it, i guess.
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.