Auto label a page older than xx time
Asked by Andrea Ghelardi:

Hello,

I'm trying to find a way or a plugin which efficiently marks/lists/labels confluence pages in a space older than say 6 months.

With a label, it will be easy to list them within confluence for further review.

Being confluence cloud, the usual plugins are not supported and scriptrunner is a bit too expensive for this specific need.

Any idea?  
thank you in advance

Andrea


Answers:
author: Andrea Ghelardi
body: Looks like I've been able to achieve my goal using the CGL Search for Confluence [https://marketplace.atlassian.com/apps/1213090/cql-search?hosting=cloud\&tab=overview](https://marketplace.atlassian.com/apps/1213090/cql-search?hosting=cloud&tab=overview)

I'm now able to add a macro "CQL search results" in a page and target pages not updated for more than 6 months using the query:  
space = xx AND LastModified \< endOfWeek("-36w") and type = page and label != "blah".

This way I can list the pages I have to further review and/or update.

I still lack the feature of "mass edit" the pages according to the search (add label, move to archive, etc) but this action can be part of the review process of every page. I.e. upon review a label "blah" can be added to the page so that it won't be included in the search list anymore.

Special thanks to [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) for pointing this solution.

Andrea


author: Ste Wright
body: Hi [@Andrea Ghelardi](/t5/user/viewprofilepage/user-id/1163948)

What's the parameters you want to add the label based on?

Some search parameters will be possible to locate via search - for example for date modified:

1. Go to Search \> Advanced Search
2. On the right-hand side select the drop-down for "Last Modified" and select Custom
3. Choose a date range - for example, modified based on dates 6-12 months ago

\^ You can expand search using an app such as [CQL Search](https://marketplace.atlassian.com/apps/1213090/cql-search?hosting=cloud&tab=overview)

I couldn't find much for auto-label management on Cloud - but there are analytics apps which would show you page views, usage, etc - see a [few options in this search](https://marketplace.atlassian.com/search?hosting=cloud&product=confluence&query=analytics) on Marketplace.

If you do want to use automation for more than just site usage - I think you are going to need to consider [ScriptRunner for Confluence](https://marketplace.atlassian.com/apps/1215215/scriptrunner-for-confluence?hosting=cloud&tab=overview) or there might be some uses in [Comala Document Control](https://marketplace.atlassian.com/apps/1215729/comala-document-control?hosting=cloud&tab=overview)?

Ste

comments: author: Andrea Ghelardi
body: hi [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) ,

first of all thank you for your reply and your advices. I made some tests but I cannot achieve my goal yet:

1. Re. the built-in search function, I tried to create a "reporting page" with only a search macro in it. The problem is that in the "data range" search I wasn't able to invert the data range parameter: if I set "1w" the engine searches for every page updated within the last week. If I try something like "-1w" the syntax is not recognised.
2. By using the advanced search I cannot set a relative date (older than 6 months) but rather fixed point in time. I'm looking for something more automated: it wouldn't be ideal to edit the search terms every week...
3. Thanks for the CQL app hint: looks interesting and I'll give it a look.
4. Looks like there are some analytics products that have potential: I'll have a look at them, thanks for that too.

My goal is to have a confluence page which dynamically (on page load) lists pages in a space which have not been updated in the last 6 months (or more) so that we can further review/update/archive them.  
Additional filters based on labels is a nice to have (so: list pages older than 6 months, but not those with label "keep_me").

In JQL terms it would be something like: project=OS and updated \< -24w and not labels="keep_me".

Cheers,  
Andrea


author: Leslie Fobi
body: I am trying to replicate this but the query draws out a search for a space lesser than 36 weeks which has no label "blah".

space = xx AND LastModified \< endOfWeek("-36w") and type = page and label != "blah".

Is there a way to just add a different label to the same search?


Tags: cloud