How do I write a rule to delete a specific label from thousands of pages?

erica_bogosian December 5, 2024

I'm currently trying to write an automated rule that removes all instances of a label from a space - we no longer use the label but it's on hundreds of pages, so manually removing it would be prohibitively time consuming. I have the rule set up like this: 

  • Trigger: Manual trigger from a page
  • Branch: Any page edited less than a day ago (the specifics don't matter to me, but I believe I need to include a branch to get the rule to apply to multiple pages)
  • Then: Remove the unwanted label.

The problem I'm running into is that branches cap at 1000 pages, and this space has almost 1500, so it's not catching every instance of the label. I tried re-running the rule, but it seems to be indexing the same 1000 pages each time. Is there a way to get this rule to cover every page in the space?

 

(Alternatively, if anyone knows another way to mass remove/delete a label, let me know...)

 

Update: Well, I solved the 1000-page limit by breaking the branches up into multiple time periods (e.g. everything edited in the past six months, everything before then, etc. [does it seem odd to anyone else there's a "more than" option but not a "less than" option there?]), but I'm still running into errors. The audit log is telling me it failed to remove labels on multiple pages, but not giving me any reason why...

Screenshot 2024-12-05 105824.png

3 answers

0 votes
Barbara Szczesniak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2024

@erica_bogosian I know you can use the information in https://support.atlassian.com/confluence-cloud/docs/use-labels-to-organize-your-content/#Browse-all-labels-for-a-space-or-site (this section of the page is followed by a section on how search for all pages with a specific label) to get the list of all pages in the space that contain every label or the label you want to remove.

I don't use automation, so I'm not sure if you can somehow use this in an automation rule.

erica_bogosian December 6, 2024

Yup, I'm aware of that feature, but while it shows me every page with a label, I would still have to open each page and remove the label manually...

0 votes
Cyrille Martin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2024

Hi @erica_bogosian 

You can use the plugin Label Manager for Confluence to bulk remove labels on pages.

Regards,

erica_bogosian December 6, 2024

Have you used it yourself? It's got a fairly low star rating so I'm wondering how effective it is.

Cyrille Martin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 10, 2024

Sorry @erica_bogosian to get back to you just now.
Before giving you the link to the app, I tested it, and worked well to remove labels on cloud instance.

0 votes
David Nickell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 5, 2024

you may find some help here:  

api-labels-id-pages-get 

if you are comfortable with REST APIs and Pagination, you would have to execute this a few times (since you can only get 250 pages per executions).

 

erica_bogosian December 5, 2024

Unfortunately I've never worked with APIs before. Not saying I can't learn! But...

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events