Maximum Change History Records Per Issue
Use this built-in script to find issues with change items that exceed the recommended amount, and delete the oldest.
Change groups left empty through the deletion of change items are also deleted. View the Atlassian documentation on the recommended number of change items and change groups. An issue is automatically re-indexed if any of its change items or groups are deleted.
Reporting
This built-in script returns all issues that contain change items over the specified maximum limit. Atlassian recommends a maximum of 20,000 change items or change groups, but you can set your own maximum value. For every change item, or set of change items, there is also a change group. We have set a default number of 10,000 change items which takes into account change groups. Change groups left empty through the deletion of change items are also deleted.
You can use the Change item filter to search for change items that fit the criteria of a script. For example, you can search for changes made by named users, or you can search for changes to a priority field. Select Example scripts to see scripts that you can use to filter change items.
Deleting change items and change groups
If this built-in script finds issues with a change item amount that exceeds the threshold, you are provided with the option to delete the oldest. You can use the Change itemfilter, as described above, if you wish to further filter issues or change items by a set criteria.
Running this built-in script
Tips
Test on your non-production instance first
Be sure to test on a copy of your production instance first. This is a destructive operation, there is no "undo" button.
Want to delete all change items that fulfil a filter?
If you wish to delete all change items that fulfil the filter, regardless of whether they are over the threshold, just reduce the threshold number to zero.
Revisit this cleanup activity
You may wish to revisit this cleanup activity, for example on a quarterly basis.