Mention a Team in Jira Cloud Automation using the Add Comment action
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
This document will provide a solution to add and mention an Atlassian Team in the Comments through the Add Comment action of the Jira Automation rule.
Environment
Jira Cloud.
Solution
Automating Comment Addition for a Jira Team upon Ticket Creation
It is possible to automate the process so that when a ticket is created, a comment is automatically written for a Jira Team. Here's a concise step-by-step guide on how to set this up using Jira Automation:
- Navigate to Your Project Settings: Go to the project where you want to set up this automation.
- Access Automation: Click on Project Settings > Automation.
- Create a New Rule: Click on Create Rule at the top right corner.
- Select the Trigger: Choose Issue Created as the trigger for this rule. This ensures the automation runs every time a new ticket is created.
- Create variable: In the Create variable action, please assign the value of the team assigned in the ticket to the smart variable TeamID. Please use the customfield ID by navigating to the Custom field page and checking the Team field ID: issue.customfield{_}10001 --> Replace with your "Team" customfieldID
- Add Action: After setting the trigger, click on Add action and select Add Comment.
- Configure the Comment: In the Add Comment action, type the message you want to be automatically posted. You can use smart values to personalize the comment, such as mentioning the reporter or including the issue key.
Basically we have to manipulate the smart values to create a link of the Team and then add it to the comment. Please add the comment like the below value:
Hello [{{issue.customfield_10001.name}}|https://sitename.atlassian.net/jira/people/team/{{TeamID}}?ref=jira$&src=issue], Comment added!
- Save the Rule: Give your rule a name and save it.
By this automation rule, each time a ticket is generated within the designated project, your predefined comment will be automatically added.
Currently, it is not feasible to send emails via Automation rules or notification schemes to a team, and we have a suggestion ticket for this functionality here:
JRACLOUD-82542 - Team Field Integration for Notification Schemes / Automation
As an alternative solution, you may establish a distinct email distribution list for this group and utilize the send email action within this automation to dispatch notifications to them.