1. Rule is triggered on: Issue Commented
- Comment Type: All Comments
2. Advanced compare condition:
- First value: {{issue.key}}
- Condition: equals
- Second Value: enter your Issue Key here (example: P-123)
3. Advanced Branching: (this will fetch the list of all Comment Ids of this Issue)
- Smart value: {{#issue.comments}}{{id}}{{/}}
- Variable name: commentId (Note: this is a user-defined Smart value variable)
4. Select action: "Delete Comment" (will be executed for for each "commentId")
- Comment id: {{commentId}}
-------------------------------------
Rule Logic:
This rule will trigger for a specific Jira Issue (based on the compare condition),
- and it will fetch the list of all comment Ids for that Issue,
- and then, for each comment id, it will execute the action "Delete Comment".
Note: The Jira Automation action "Delete Comment" cannot be executed on a list of Comment Ids. So, we need to pass only a single Comment Id at a time to this "Delete Comment" action.
You will need to change my original series of steps and try along the following lines:
Step 1 (When): Rule is triggered on:
"Issue Transitioned" from "In Progress" to "Done".
Step 2 (Condition): Status equals Done
Step 3. Advanced Branching: (this will fetch the list of all Comment Ids of this Issue)
- Smart value: {{#issue.comments}}{{id}}{{/}}
- Variable name: commentId (Note: this is a user-defined Smart value variable)
Step 4: If (smart values condition):
First value: {{issue.comments.author.displayName}}
Condition: equals
Second Value: "user's display name"
Step 5: Then (Action):
Remove comment from issue
Comment Id: {{commentId}}
This automation rule will delete all comments by the specific user when the status of any issue changes from 'In Progress' to 'Done'.
Caution: Implement and test this rule on a test Jira issue before rolling out in production.
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Jira Administrator
Configure Jira Software, Jira Core, or Jira Service Management, including global settings, permissions, and schemes.
Managing Jira Projects Cloud
Learn to create and configure company-managed projects in Jira Software and partner effectively with Jira Admins.
Learning Path
Become an effective Jira Software Project Admin
This learning path is designed for team leaders who configure Jira Software projects to match a team's processes.