Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Code snippet to send emails to members of group(s) selected in the multi-group picker field

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

  1. Navigate to the intended workflow to make the necessary changes in the edit mode.

  2. Select the required transition.

  3. Select the Post functions tab and click Add post function.

  4. Add the Email issue (JMWE app) post-function.

  5. 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()


    Replace 12300 with the id of the multi-group picker custom field.

“Email issue (JMWE app)” post-function

Publish the workflow for the changes to be applied as configured.

References