Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 desired workflow transition and add the “Email intended workflow to make the necessary changes in the edit mode.

  2. Select the required transition.

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

  4. Add Email Content (:
    Email content: Enter Subject, Text Body)Under “Recipients”, add the below script in “Users as needed.
    Recipients: Enter the following in Users from script:

    Code Block
    languagegroovy
    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.

...

...

Publish the workflow to apply the changes as configured.

References