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 page.

Code Block
languagejava
linenumberstrue
struct state {
    string name;
    string initial;
    string colour;
    string hideStates;
    string taskable;
    string changeDueDate;
    string final;
}

struct comalaState {
    string expand;
    string workflowName;
    state state;
    string [] messages;
}

if(space != "AS") {
    //Create request
    HttpRequest request;
    HttpHeader authHeader = httpBasicAuthHeader("jmuse", "M@tt_0518");
    request.headers += authHeader;
     
    //Post data and get response
    comalaState cs = httpGet("http://localhost:8090/rest/cw/1/content/" + id + "/status", request);
    
    
    if(cs.state.name == "Archive") {
    
        addComment(id, "Moving page to archive space");
        number archiveHome = getPage("AS", "Archive Space Home");
        movePage(id, archiveHome);
    }
}

See Other Recipes

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

See More Documentation

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