Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This script will add a new label to all of the child pages of the selected parent pagesend an email with a list of pages that have an expired state.

Code Block
languagejava
linenumberstrue
//new labels to be added to pages
stringnumber [] newLabelsissues = "confluence|power_scripts"selectPages("stateexpiry > startOfDay()");

//get the id of the parent
number parent = getPage("CTR", "Add a new label to the children of a page");

//get the ids of the children
number [] children = getChildPages(parent)string body = "<p>The following pages are past the expiry date:</p>";
body += "<ul>";

for(number childi in childrenissues) {
//loop through children
    //add labels to the child page
    addLabels(child, newLabels);
}body += "<li><a href=\"" + i.tinyLink + "\">" + i.title + "</a></li>";
}

body += "</ul>";

return body;

See Other Recipes

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "pages"

...