How to add labels to confluence pages in bulk?

Rahini Balamurugan August 6, 2021

We are using confluence server. I know how to add label to a particular page. but I wanted to know if there is an option for the below requirement?

  •  Is there a way to select multiple pages and do a bulk update to apply a label ?
  • Is a way to apply a label recursively from the parent page to all of the corresponding child pages. 
  • At last, what are all the available options to apply labels to pages in Confluence.

    Kindly someone help !!!!!

 

~Rahini

4 answers

3 accepted

2 votes
Answer accepted
Kishan Sharma
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 6, 2021

Hi @Rahini Balamurugan You can use REST API to find out pages by content ID and apply labels to them. Alternatively if you have ScriptRunner for Confluence app you can do some bulk operations on labels. Refer this thread for details.

0 votes
Answer accepted
Rahini Balamurugan August 9, 2021

@Kishan Sharma / @Jillian Patterson ,

Can you share the steps for updating labels in bulk using REST API for confluence? 

 

Thanks,

 

Rahini

Kishan Sharma
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2021

Please refer Add Labels method to add labels to your confluence page. You can try it once on a sample page. Once you find it working, just use "Get content" method to get all your pages IDs, and loop through them and add labels to them one by one.

Rahini Balamurugan August 9, 2021

Thanks @Kishan Sharma 

Rahini Balamurugan August 10, 2021

@Kishan Sharma / @Jillian Patterson ,

curl -u admin:admin -X GET "https://devconfluence61000.example.com/display/RS/API+TESTING+page

The above command retrieves the entire page details along with the label name.

whereas, while using the page id of the above page like below

curl -u admin:admin -X GET "https://devconfluence61000.example.com/confluence/rest/api/content/301663506/label"

The above command also retrieves the entire page details but I couldn't see the label details.

 Please help !!!

Kishan Sharma
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 10, 2021

In the second command you should get a response something like this -

{"results":[{"prefix":"global","name":"label1",

here label1 is the label attached to the page. 

Philip Domenico
Contributor
April 21, 2022

How about for the those of use who are NOT admins?

Like # people like this
0 votes
Answer accepted
Jillian Patterson August 9, 2021

Hi @Rahini Balamurugan

Like Kishan mentioned, if you've got ScriptRunner for Confluence you can add, remove, or rename labels in bulk (and many other operations) and code-free using the built-in scripts. Hope that helps!

Rahini Balamurugan August 9, 2021

Sure thanks @Jillian Patterson and @Kishan Sharma 

we are not having ScriptRunner for Confluence. Do we have any plugin which will help me?

 

Thanks!!!!

0 votes
Stavros_Rougas_EasyApps
Atlassian Partner
October 17, 2023

This post is from 2021 @Rahini Balamurugan, if you have moved to cloud then you might want to get an app. For us it was important to restrict some label features, like merging, so we built an app called Label Manger by Easy Apps that does this.

In my opinion you don't want all users having access to all the bulk editing features.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events