Label Hierarchy
Asked by EtienneD:

Hi,

I need (e.g.) the pages created for the whole HR team (label: ***team_hr*** ) to be seen by people who look for documents related to a team that belongs the HR Dpt (label: ***team_payroll***).

I will ask the writers of the space to put the most precise labels on the page (in this case ***team_payroll).*** And if a writer writes a page that apply to the whole HR Dpt, he will set a ***team_hr***label.

So I want that the user who looks for pages labelled ***team_payroll*** gets also the pages labelled ***team_hr***.

It would be nonsense to ask the writer who is writing a page for the payroll team to set a ***team_hr*** label, because then, the other teams in the HR Dpt (say the legal team) would also get pages that are irrelevant to them.  

I may set pages with the hierarchy that I want for "something" that could use that reference page to provide the expected results. I could even script the hierarchy in a Comala Document Management workflow with *{trigger}* macros (although it would be hard to maintain).

Maybe there in something in CQL or SQL to use but if so, I will need your help to make the search (based on labels OR on page properties) efficient.

I hope I made it understandable. If not, just ask, I will give any detail you need.

My environnement : Confluence Data Center 7.19.4


Answers:
author: Brant Schroeder
body: [@EtienneD](/t5/user/viewprofilepage/user-id/1191612) What you are asking for does not exist and I am not aware of any apps in the marketplace that provide this functionality. We usually set up our own labeling hierarchy when we set up our spaces. We do this using templates to minimize mistakes and overhead on the worker.

If I were setting up your space I would have a naming convention like this:

* team_hr
  * team_hr_payroll
  * team_hr_benefits
  * team_hr_legal
* team_fin
  * team_fin_procurement

If I created a template for Payroll it would include the parent label of team_hr and the label team_hr_payroll. Then it would allow individuals to search for all payroll pages or all hr pages. All hr pages would include payroll, benefits and legal.

comments: author: EtienneD
body: ok, I get what you mean, thanks for the idea.

doing so,

* if I search for *team_hr_payroll* , --\> I will get the pages bearing the *team_hr_payroll* label
* if I search for *team_hr* , --\> I will get the pages bearing the *team_hr* label, i.e. all the pages for HR Dpt

BUT there will be some pages that will bear only the *team_hr* label: pages that are valid for ALL teams in the HR Dpt. Therefore, when I search for *team_hr_payroll*, I want to see

* the pages bearing the *team_hr_payroll* label
* PLUS the pages bearing the *team_hr* label WITHOUT the pages bearing anything else than *team_hr_payroll.*

A way to do it in (MS Access) SQL could be

*SELECT Table1.\[page name\], Last(Table1.label) AS label*   
*FROM Table1*   
*WHERE (((Table1.label) Like "team_hr\*"))*   
*GROUP BY Table1.\[page name\]*   
*HAVING (((Count(Table1.\[label\]))=1));*

*UNION*

*SELECT Table1.\[page name\], Table1.label*   
*FROM Table1*   
*WHERE (((Table1.label)="team_hr_payroll"));*

but it seems a little bit complex.  

If you have a simpler idea, I would greatly appreciate it


Tags: confluence-server

server