Hello,
I don't know how to set a condition where an email will only send if the recipient belongs to a specific group.
I'm trying to add a condition within the post-function that sends an email after a transition. The condition is that the custom field--which identifies a person (not an assignee or reporter) with a specific role in the issue--should belong to a specific group in order for the email to be sent.
Here is the code that I typed:
issue.get("project")?.name == ("Testing") && issue.getAsString("customfield_10110") in xyz Group.
I basically don't know what should follow after identifying the customfield that I want to check.
I'm using the Update parameters of the Email issue (JMWE add-on) Function for this transition
Hi Luis,
JMWE app has a Groovy editor help in the post-function configuration that helps you in writing your Groovy scripts. For example, to check that the issue belongs to a specific project, in the editor help click on "Issue Fields", select "Project" and the help will show you some useful examples.
You should modify your code to this:
issue.get("project").name == "Testing" && ComponentAccessor.groupManager.isUserInGroup(issue.get("customfield_10110"), "xyz")
Regards,
Radhika
Hi Radhika,
Thank you for your response. It works now!
Regards,
Luis
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.