Automatically send an email to all members of a Jira project role

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Sometimes we need to send emails to specific project role users. The send email action in Jira Automation can send emails to user picker fields and groups only.

In this article, we create an automation to get the users’ email addresses within a role, and with that, be able to send emails to them.

This feature request is opened to have this implemented:

Solution

Determine project and role IDs

IMPORTANT NOTE: Users intended to receive the email must have their email address visible under their account settings. Please refer to:

  • Identify the role you would like to send the email to:

    1. Access the following URL to get the list of the roles you have within the project,

    2. We will use the role ID in our automation rule, as project role names aren't supported

      https://<yourinstance>.atlassian.net/rest/api/3/project/{projectid}/role/
    3. This endpoint lists roles available for your project

    4. You should be able to identify the role ID in the URLs listed, for example: /role/{roleid}

Automation rule to notify each email address in a project role

  1. Trigger: Work item Created

    1. You can select another trigger based on your requirements

  2. Action: Send a web request

    1. Request URL: https://<yourinstance>.atlassian.net/rest/api/3/project/{projectid}/role/{roleid}

      1. Replace the Project ID and Role ID with the appropriate values from above

    2. Headers:

      1. Authorization: Basic <base64_encoded_api_token>

      2. Content-type: application/json

    3. HTTP Method: GET

    4. Web Request body: Empty

    5. Delay execution...: checked

This request generates a payload with all email addresses in the specified project role.

  • Add a Branch - Advanced branch:

    1. Smart value: {{webResponse.body.actors.actorUser.accountId}}

    2. Variablename: newusers

In our advanced branch, we will execute the subsequent actions for each of the results (each email address) as a variable, in this example {{newusers}}

  1. Add a new Send web request action:

    1. Request URL: https://<yourinstance>.atlassian.net/rest/api/3/user/search?accountId={{newusers}}

    2. Headers:

      1. Authorization: Basic <base64_encoded_api_token>

      2. Content-type: application/json

    3. HTTP Method: GET

    4. Web Request body: Empty

    5. Delay execution...: checked

  2. Add a Send email action:

    1. To: {{webResponse.body.emailAddress}}

    2. Subject and Content: Your choice

Updated on May 22, 2025

Still need help?

The Atlassian Community is here for you.