How to delete comments from issues
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
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.
ソリューション
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.
[自動化を作成] を選択します。
ルールの詳細を次のように指定します。
- 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
次のページは、課題コメントの削除に使用される API にリンクしています。
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.