Manage Labels

Use this script to rename, add, and remove page labels in bulk. 

Labels can't contain spaces or uppercase letters. If you want a label to contain more than one word, use an underscore or a hyphen, which are the only two special characters allowed. They can contain a maximum of 255 characters.

Run the script

There are three different ways to run the script, outlined in the following tasks: 

Adding Labels

  1. Navigate to General Configuration > ScriptRunner > Built-In Scripts.
  2. Select Manage Labels.
  3. Choose the Content Type from: 
    • All Content Types
    • Page
    • Blog
    • Attachment
  4. Choose the Location.

    • To work with the entire instance, choose All Spaces
    • To work with an entire space, choose Select Spaces, and then choose the Target Space(s).
    • To work with certain pages in a space, choose Select page(s) within a specific space, and then choose the Space and Page(s)

      This is unavailable if you're working with All Content Types in Content Type.

  5. For Label Action, choose Add Label(s)
  6. Enter the Label Name(s) you would like to add to the selected space and pages.

    If All Content Types is selected for Content Type, the action type also applies to attachments on pages.

  7. Select Run.
    You can select Preview instead of Run to view changes before implementing them. 
    Once you select Run, the Results of the script appear.
    The Manage Labels form filled out with the Add Labels example content

Results

The labels that were added appear on the Results list: 

The results of the script with the Add Labels example content

Removing Labels

  1. Navigate to General Configuration > ScriptRunner > Built-In Scripts.
  2. Select Manage Labels.
  3. Choose the Content Type from: 
    • All Content Types
    • Page
    • Blog
    • Attachment
  4. Select the Location where you want to run the script:

    • To work with all spaces, choose All Spaces.

    • To work with certain spaces, choose Select Space(s), and then select the Target Space(s).

    • To work with certain spaces and pages, choose Select page(s) within a specific space, and then choose the Space and Page(s)

      This is unavailable if you're working with All Content Types in Content Type.

  5. Select Remove Label(s)
  6. Enter the Label Name(s) you would like to be removed from selected or all spaces.

  7. Select Run.
    You can select Preview instead of Run to view changes before implementing them. 
    Once you select Run, the Results of the script appear.
    The Manage Labels form filled out with the Removing Lables example content

Results

The labels that were removed appear in the Results list: 

The results of the script for the Removing Labels example

Renaming Labels

  1. Navigate to General Configuration > ScriptRunner > Built-In Scripts.
  2. Select Manage Labels.
  3. Choose the Content Type from: 
    • All Content Types
    • Page
    • Blog
    • Attachment
  4. Select the Location where you want to run the script:

    • To work with all spaces, choose All Spaces.

    • To work with certain spaces, choose Select Space(s), and then select the Target Space(s).

    • To work with certain spaces and pages, choose Select page(s) within a specific space, and then choose the Space and Page(s)

      This is unavailable if you're working with All Content Types in Content Type.

  5. Select Rename Label(s)
  6. Enter the Original Label Name(s) of the new label and the New Label Name you want the label to be called.

  7. Select Run.
    You can select Preview instead of Run to view changes before implementing them. 
    Once you select Run, the Results of the script appear.
    The Manage Labels script form filled out with the Renaming Labels example content

Results

The pages that have labels that were renamed appear in the Results list: 

Results of the script with the Renaming Labels example

On this page