Comala Workflow - How to change status of several pages?
Asked by Philippe ROUSSEL:

Hi,

I don't find this in the Community...

How to change **the status of all pages in a tree structure** (menu)?

I have to change status of hundreds pages (but not all the space).

Thanks a lot for your help.


Answers:
author: James Conway
body: Hello [@Philippe ROUSSEL](/t5/user/viewprofilepage/user-id/3787813)

The suggestion by [@Matteo Gubellini _SoftComply_](/t5/user/viewprofilepage/user-id/641360) is valid and may be the right one depending on your use case.

An alternative is to use what we call a 'cascade workflow'...

1. As this is a fairly large operation, we would recommend rebuilding the Confluence Search Index because if the Search Index is out of sync, it can disrupt the process.
2. Add the following space workflow (not a template or label restricted space workflow) to the space. Be sure to keep your existing workflows active and to also change STATE A and STATE B to the appropriate states. With STATE A being the current state and STATE B being the desired state:  

       {workflow:name=Cascade}
       {trigger:labeladded|label=cascade}
           {set-label:cascade|children=true}
           {remove-label:cascade}
       {trigger}
       {trigger:labeladded|label=cascade|state=STATE A}
           {set-state:STATE B|comment=changed by Space Admin}
       {trigger}
       {workflow}

   Basically, the first trigger adds the "cascade" label to all the pages immediate children (not grandchildren) and removes "cascade" from current page. The second trigger also fires on the labeladded event for "cascade" but also checks the existing state before firing off the action to change the state.
3. Add the "cascade" label to the space home page(or all top level pages in the space if you have more than one). **Note**: when you add the label it will be immediately removed by the workflow so it will look like it didn't work, but it did.
4. Now sit back, relax, and wait a few minutes for the workflow to do its thing. It should only take a minute or two but may take longer on a large space. To confirm its done, go to the workflow report and look for any pages with old state name.
5. Remove the workflow.

If you have further questions or wish to validate your workflow for your precise use case, please contact our Customer Success team at <https://support.comalatech.com>, it would be helpful if you could attach your [workflow markup](https://wiki.comalatech.com/display/CDML/Markup+editor+in+workflow+builder) as a txt file.

Kind regards

James  
Senior Product Manager

comments: author: Philippe ROUSSEL
body: Thanks a lot!!!

This solution is totally perfect.


author: Matteo Gubellini _SoftComply_
body: Nice, I was not aware of this feature!


author: Matteo Gubellini _SoftComply_
body: Hi,

There is nothing built into the system, but you can use the approve children macro to do it.

In this case you will need to put all the docs you need under one parent page, assign a simple workflow to the parent page and use the approve children macro inside it. The children pages will have to be in an approval state and ready to be approved.

I should have an example somewhere, let me know if you need it.

Matteo

comments: author: Timo Winkler
body: Hi Matteo,

Is it still possible to see the example?

<br />

Cheers

Timo


Tags: comala

confluence-server

server