Maximum Number of Issue Links Per Issue

Use this built-in script to find issues that contain more issue links than the recommended amount, and archive or delete the oldest. View the Atlassian documentation on the recommended number of issue links. 

Issue links screenshot

Reporting

This built-in script returns all issues that are over the specified maximum number of issue links. Atlassian recommends a maximum of 1,000 issue links per issue, but you can set your own maximum value.

You can use the Link type(s) filter to search for specific issue links only. You can also use the Issue link filter to search for issues or issue links that fit the criteria of a script. For example, you can search for issues that have a named issue as a destination link, or you can search for issues that have a named issue as a source link. Select Show snippets to see example scripts that you can use to filter issues.

Issue links are permanently deleted. You cannot retrieve deleted issue links without restoring from a backup. 

If this built-in script finds issues with issue links that exceed the selected amount, you have the option to delete the oldest issue links. You can use the Link type(s) filter and Issue link filter, as described above, if you wish to further filter issues or issue links by a set criteria.

Delete issue links screenshot

Running this built-in script

  1. From ScriptRunner, navigate to Built-in Scripts → Guardrails: Maximum issue links per issue.
  2. Enter a value under Max issue links, or leave at the default of 1,000 issue links.
  3. Select the project(s) you wish to search, or leave the Project(s) field blank to search all projects.
  4. Select the type of link you wish to search, or leave the Link type(s) field blank to search all link types.
  5. Under Execution type, select one of the following options:

    Archiving is available for Data Center only.

    • Archive issues. Select this option if you want to archive issues that match your search parameters.
    • Delete issue links. Select this option if you want to delete the oldest issue links of issues that match your search parameters.
  6. Enter a script into the Issue link filter script console, if you wish to further filter issues. 
  7. Select Preview to display the number of issues that match your search parameters. 
  8. Perform one of the following options:
    • Select Archive X issue(s) if you wish to archive the selected issues.
       
    • Select Permanently delete X issue link(s) if you wish to delete the oldest issue links of the selected issues.

      Issue links are permanently deleted. You cannot retrieve deleted issue links without restoring from a backup. 

Restoring archived issues

If you have archived an issue and wish to restore it, see how to restore an issue in the Atlassian documentation.

Tips

Test on your non-production instance first

Be sure to test first on a copy of your production instance. Deleting is a destructive operation, there is no "undo" button.

Delete archived issues after a set amount of time

We recommend that you delete archived issues if they haven't been restored or asked about since X months/years after archiving. The amount of time depends on your company policy when it comes to such matters.

On this page