How to delete comments from issues
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Adding unlimited comments to issues often resulted in unusual load times, which in some cases caused reliability and performance problems.
With many comments across different issues and a lack of good ways to delete them in bulk ( JRACLOUD-91983 - Getting issue details... STATUS ), we don’t expect you to jump into your issues and remove the comments one by one.
Solution
Jira doesn’t have an easy way to delete comments in bulk. Below are some options:
Option 1: Delete all comments with Jira Automation
You can use Jira Cloud’s automation to delete comments in bulk.
To create a rule that deletes all comments (the comments can't be restored):
Go to the Automation Rules page.
Select Create automation.
Specify rule details as follows:
- Trigger: Manual trigger
- Advanced branching:
- Smart value: {{issue.comments.id}}
- Variable name: commentId
- Action: Delete comment
- comment id: {{commentId}}
Option 2: Delete comments older than a specific date with API
The following pages link to APIs used to delete issue comments.
Get a list of comment IDs under an issue: GET comments
Delete a comment based on its ID: DELETE comment
Below is an example of a Python script that can be used to delete comments:
- Remember to install python3 first and then jira and requests libraries before running it.
- The advantage of using the API is that you can define a cutoff date and only delete comments older than the cutoff date.
Please be aware that the usage of the below script is not supported.