Content By Label - required labels and the AND OR operator

So there is some good discussion on the Content by Label documentation page, specifically around how the required labels and operators work. I am trying to understand the intended behavior because as far as I am seeing, its not behaving correctly (using 4.3 at the time of this post).

Please see the following scenarios and what I would expect based on the conversations on that page above. Note: I am assuming the order of labels does not affect anything.

Configuration: labels=aa,bb,+cc,-dd
Operator: OR (default)
Expected Logical Representation: (aa OR bb) AND cc AND NOT dd
Actual Behavior: aa OR bb AND cc AND NOT dd

Configuration: labels=aa,bb,+cc,-dd
Operator: AND
Expected Logical Representation: (aa AND bb) AND cc AND NOT dd

The problem I am seeing is in the first scenario, where I am getting results with pages that just have "cc". I would expect pages that have "cc", but also "aa" or "bb". I would want non-required labels to be grouped in parenthesis so the operator applies to just them. I'd expect this behavior because if we just had "aa,bb" it would only return items with 1 or more of those, not 0 or more (i.e. every page in your instance). Having a required-label shouldn't break that behavior.

3 answers

1 accepted

This question is not answered but I will close it to stop the automated emails asking me to close/answer it. I created an issue against the Confluence Content By Label macro.

https://jira.atlassian.com/browse/CONF-29796

Check that for closure, and if it gets closed I will be sure to update this post with the info.

Hello,

I think I have the same topic as David.

My confluence pages have different labels A, B and C and I am looking for a solution that does the following:

  • Show all the pages that include (A+B) or (A+B) or (A+B+C)
  • Do not show pages that only include (A) or (B) or (C) or (B+C)

The Content by Lable macro has different combinators as described at https://confluence.atlassian.com/display/CONF43/Content+by+Label+Macro

But I can't find a combination that works:

  • "labels=+A, B, C" also shows (A) alone with "Operator: OR" and shows only (A+B+C) with "Operator: AND"

Any other ideas?

The expected logical representation for OR to my knowledge is based on your labels is:

Can have aa OR bb, must have cc, and can't have dd

For AND is would be:

Can have aa AND bb, must have cc, and can't have dd

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

457 views 18 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you