/
Replace a label with a different one
Replace a label with a different one
This script will remove an old label from a page and replace it with a new one.
string oldLabel = "old_label"; string newLabel = "new_label"; //get all pages with the old label number [] pages = selectPages("label = \"" + oldLabel + "\""); //loop through each page for(number page in pages) { //get the pages labels string [] lbls = %page%.labels; //remove the old label from the labels list lbls = arrayDeleteElement(lbls, oldLabel); //add new label to the list lbls += newLabel; //set the labels for the page setLabels(page, lbls); }
See Other Recipes
See More Documentation
, multiple selections available,
Related content
Add a new label to the children of a page
Add a new label to the children of a page
More like this
Comala Workflows - Move page
Comala Workflows - Move page
More like this
renamePage
renamePage
More like this
How to remove a label from a set of pages
How to remove a label from a set of pages
More like this
Delete all labels of a Confluence page.
Delete all labels of a Confluence page.
More like this
addLabels
addLabels
More like this