How do I write an automation to delete all labels on a page?

Paul Rathgeb May 20, 2024

I'm trying to figure out how to delete all labels on a page when a trigger occurs. I see a way to delete specific labels, but is there a way to delete all of them?

 

If it's NOT possible to create this automation, is there a way to restrict a space so that only specific Users can create labels?

 

Thank you!

1 answer

1 accepted

0 votes
Answer accepted
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2024

Hi @Paul Rathgeb 

As per the documentation what you can try is use the "Remove Label" Action (https://support.atlassian.com/cloud-automation/docs/actions-in-confluence-automation),

with the page.labels smart value (https://support.atlassian.com/cloud-automation/docs/smart-values-in-confluence-automation/#hardBreak).

Let me know if this works.

Paul Rathgeb May 20, 2024

It appears that neither directly nor through a third-party app, that it is possible to control the use of labels. Such a pity. Labels could be very powerful, but given their implementation by Atlassian, the likelihood of clutter to the point of uselessness is very high. It would be great if we could better control and manage their use.

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 21, 2024

Hey @Paul Rathgeb 

So you want to "Delete" the label altogether, and not just remove them from a certain page? Is that the use case you're targeting here?

Paul Rathgeb May 21, 2024

Very close. The use case is: WHEN a trigger occurs, THEN remove all labels from the page.

 

I don't necessarily know what the labels are, but I know I want them all removed.

 

Another approach would be to simply limit who is allowed to add labels, but so far the resounding answer is, that's not possible.

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 21, 2024

@Paul Rathgeb with this as your use case "WHEN a trigger occurs, THEN remove all labels from the page", my first answer still applies.

As per the documentation what you can try is use the "Remove Label" Action (https://support.atlassian.com/cloud-automation/docs/actions-in-confluence-automation),

with the page.labels smart value (https://support.atlassian.com/cloud-automation/docs/smart-values-in-confluence-automation/#hardBreak).

 

 For reference this is what the rule would look like:

g0m1LjScfD.png

Like Paul Rathgeb likes this
Paul Rathgeb May 21, 2024

Thanks. Unless I'm missing something, this rule requires one to know the label one wishes to remove. In my scenario, I won't know the label name, I just want to remove all labels from the page. Is there a wildcard character that removes all labels with this rule?

 

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 21, 2024

The Smart value page.labels.name does exactly that.

You can read up more on Smart values from the previously shared links 🙂

Like Paul Rathgeb likes this
Paul Rathgeb May 22, 2024

Wow! That works very well! Thank you!!!

 

I used a different trigger, as I am not sure how Manual Triggers work, but the rest is fantastic!!!

Like Jehan Bhathena likes this
Stavros_Rougas_EasyApps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 17, 2024

@Paul Rathgeb why do you need to remove all labels from certain pages.

We have a Confluence app, Label Manager by Easy Apps (it's also a feature of Space Content Manager), so I'm curious if this is a use case we should consider building.

Suggest an answer

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

Atlassian Community Events