Hello,
My post-function is supposed to run only if my "Reported on behalf of" field is blank and the creator of the issue is NOT in my "team-student-consultants" group.
The conditional execution isn't working...and I'm almost positive it has to do with my syntax after the two pipes. Here is my unsuccessful groovy script:
issue.get("Reported on behalf of")!= null || ! ComponentAccessor.getGroupManager().isUserInGroup (issue.get("creator"), "team-student-consultants")
Any suggestions?
Thanks in advance!
Hi Andy,
you seem to have inverted the condition. Why is that? Based on your description, it seems that the condition should be :
issue.get("Reported on behalf of")== null && ! ComponentAccessor.getGroupManager().isUserInGroup (issue.get("creator"), "team-student-consultants")
Hi David,
I need the post function to run only if the field Reported on behalf of is not blank or the creator is not a member of the team-student-consultants group.
My logic was wrong here and using && instead of || as you did in your code works!
Final code is,
issue.get("Reported on behalf of")!= null && ! ComponentAccessor.getGroupManager().isUserInGroup (issue.get("creator"), "team-student-consultants")
Thank you for your help!
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.