Hi Atlassian Community,
I have the following condition for a script post function (send a custom email) configured:
(issue.getSummary().find('STRING1') || issue.componentObjects*.name.contains('STRING1')) && !(issue.reporter?.displayName.equals('Standby'))
I would also like to add a description field check when STRING2 is also included in the issue description (AND). I tried adding "&& (issue.getDescription().find('STRING2')" but this did not work and threw an groovy error during the custom mail preview.
Thank you for your assistance.
Regards
Hi @Ken ,
It seems that you just forgot closing brace. This should work:
(issue.getSummary().find('STRING1') || issue.componentObjects*.name.contains('STRING1')) && !(issue.reporter?.displayName.equals('Standby')) && (issue.getDescription().find('STRING2'))
thank you very much. I will try this out. Another question:
If i wanted to add an additional STRING3 to be compared if either STRING2 OR STRING3 exists, could i do it like this:
(issue.getSummary().find('STRING1') || issue.componentObjects*.name.contains('STRING1')) && !(issue.reporter?.displayName.equals('Standby')) && (issue.getDescription().find('STRING2')) || (issue.getDescription().find('STRING3'))
Or could I do it all in one check like this: issue.getDescription().find('STRING2','STRING3'))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not a groovy expert but I think you need
(issue.getSummary().find('STRING1') || issue.componentObjects*.name.contains('STRING1')) && !(issue.reporter?.displayName.equals('Standby')) && (issue.getDescription().find('STRING2') || (issue.getDescription().find('STRING3')))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.