JMWE Cloud: Send emails to members of groups excluding selected members
JMWE’s Email issue post function lets you send emails to members of selected groups. However, to exclude certain users, you must write a Nunjucks script to filter them out manually.
Instructions
This can be done using the following configuration in the JMWE Email issue post function:
Select “Users from template” instead of “Specific groups” or “Groups from template”
Use the following script:
{% set usersString = "" %} {% set omittedUsers = ["Omitted User 1", "Omitted User 2"] %} {% for user in "group-name" | groupMembers(false) %} {% if user | field ("displayName") not in omittedUsers %} {% set usersString = usersString + "," if usersString != "" %} {% set usersString = usersString + user | field("accountId") %} {% endif %} {% endfor %} {{ usersString }}
Replace group-name with the appropriate group name and Omitted User with the display name of the user you want to exclude. This script omits users based on their Jira display names.