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.
Hello, Did this actually work for you guys? The first example is OK (deleting all comments)
The second never seems to work (compare finds no matchs)...but it should...
I just need to delete comments from a particular user
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Improve user experience across Jira with global settings
Learn how to set up and configure a Jira site, manage Jira permissions, and configure Jira apps and integrations.
Learning Path
Streamline projects across Jira with shared configurations
Build Jira work items with reusable configurations called schemes, and reduce administrative work with automation.
Learning Path
Become an effective Jira software project admin
Set up software projects and configure tools and agile boards to meet your team's needs.