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
//newselect labels to be added to expired pages
stringnumber [] newLabelspages = "confluence|power_scripts"selectPages("stateexpiry < startOfDay()");

//get the id ofCreate HTML message for email
string body = "<p>The following pages are past 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);

for(number child in children) { //loop through children
    //add labels to the child page
    addLabels(child, newLabels);
}expiry date:</p>";
body += "<ul>";

//loop through each expired page
for(number p in pages) {
	//add expired page to email HTML
	body += "<li><a href=\"" + p.tinyLink + "\">" + p.title + "</a></li>";
}
//close out HTML
body += "</ul>";

string [] to = {"john.doe@email.com", "jane.doe@email.com"};
string [] cc = {"jack.doe@email.com", "jeff.doe@email.com"};

sendEmail("", to, cc, "These pages need your attention!", body);

See Other Recipes

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "pages"in ("integrations","comala")

See More Documentation

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