This article provides the code snippet to send emails to users in the group(s) selected in a multi-group picker field in the Email issue (JMWE app) post-function.
Instructions
Navigate to the intended workflow to make the necessary changes in the edit mode.
Select the required transition.
Add the Email issue (JMWE app) post-function.
Add:
Email content: Enter Subject, Text Body as needed.
Recipients: Enter the following in Users from script:def users = [] def groupManager = ComponentAccessor.getGroupManager() def groups = issue.get("customfield_12300") for (group in groups) { for(user in groupManager.getUsersInGroup(group)) users.add(user) } return users?.unique()
Replace12300
with theid
of the multi-group picker custom field.
Publish the workflow to apply the changes as configured.