Page Properties Report Macro Filter forgetting the NOT (-)
Asked by John Dawson:

I've been using the Page Properties Report Macro, which I've fount to be very useful. I have used the filter feature to filter out certain pages. However, any time I go back into the Macro settings to change something, all the filters loose the "-" prefixes, so that the filters end up filtering *for* those pages, instead of filtering them out - effectively the opposite of the intention. I have to remember to go back and put the NOT qualifiers back into each filter, every time I edit *anything* in the Macro.

I'm sure this isn't intended behaviour. The form shouldn't strip out "-" from filter boxes ever time the Macro is edited. Unless I'm missing something. Anyone else experienced this, or can anyone think of anything I might be doing wrong to cause this behaviour?

Thanks,

John


Answers:
author: Alex Koxaras _Relational_
body: Hi [@John Dawson](/t5/user/viewprofilepage/user-id/5209480) and welcome to the community,

I wasn't able to reproduce your problem. Adding "-" to labels, will be retained on my instance, even if I edit the page. Can you please write down all the steps you take, in order to be able to reproduce your problem?

comments: author: John Dawson
body: Hi Alex,

Ok, here are my steps. First setting up a working filter for an existing macro:

1. Put confluence page into editing mode, then click on the existing Page Properties Report, and click the edit button at the bottom.

![Screenshot 2023-05-03 092123.png](https://community.atlassian.com/t5/image/serverpage/image-id/254978i1B36EB0CA28842B5/image-size/large?v=v2&px=999 "Screenshot 2023-05-03 092123.png")

2. Click add a filter. I have experienced this problem using the "Including text" filter and the "With title" filter. I haven't tried "-" in other filters.

3. Add a filter with a "-" (not) modifier. Here I am filtering out pages that contain the word template.

![Screenshot 2023-05-03 092759.png](https://community.atlassian.com/t5/image/serverpage/image-id/254983iDCBD066D8E0C8E13/image-size/large?v=v2&px=999 "Screenshot 2023-05-03 092759.png")

4. Click save and publish the confluence page. The report successfully shows all the pages with the specified label, except for the pages containing the word template.

Then, producing the error:

5. Put confluence page back into editing mode, then click on the existing Page Properties Report, and click the edit button at the bottom.

![Screenshot 2023-05-03 092123.png](https://community.atlassian.com/t5/image/serverpage/image-id/254978i1B36EB0CA28842B5/image-size/large?v=v2&px=999 "Screenshot 2023-05-03 092123.png")

6. Observe the filters. The "-" character is now missing from the "Including text" filter.

![Screenshot 2023-05-03 093342.png](https://community.atlassian.com/t5/image/serverpage/image-id/254984i05BB67A8EE8788E1/image-size/large?v=v2&px=999 "Screenshot 2023-05-03 093342.png")

7. At this point you can make changes to the other fields, or make no changes, but if you click save, the macro will be saved with the changed filter. Now the report lists only pages that contain the word template. The same behaviour happened with the "With title" filter. I haven't tested other filters as well.

Edit: so to clarify, this isn't for the labels filter, rather the problem is with other filters


author: Alex Koxaras _Relational_
body: [@John Dawson](/t5/user/viewprofilepage/user-id/5209480) thank you for clarifying this!

I was able to reproduce it. However, documentation reads:
> For a NOT search, enter **a minus sign (-) before the label**. This'll exclude everything with that label.

It doesn't say anything about any other filter, which makes me think if the minus should be applicable in the first place (I know it's working with the minus..). I didn't find anything related to your exact problem at jira.atlassian.com, except [CONFCLOUD-70713](https://jira.atlassian.com/browse/CONFCLOUD-70713), which is not exactly your problem.

Having said the above you have two choices:

* Create a suggestion [here](https://jira.atlassian.com/issues/?filter=98688&jql=project%20%3D%20CONFCLOUD%20AND%20summary%20~%20%22page%20report%20property%22%20AND%20resolution%20%3D%20Unresolved%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC&startIndex=50)
* Raise a bug at <https://support.atlassian.com/contact>


author: John Dawson
body: Thank you Alex. I think I will raise a bug report. It is odd behaviour, even if the minus character isn't supposed to be used for all filters.

Ultimately I think I need to find a better way to filter out my template pages. They are identical in every way from production pages, except for the strapline at the top about them being templates, that the user would naturally delete after copying. I could add a template label, which I can filter out, with instructions for the user to remove that label when publishing, but I can see that being missed. I was trying to keep the experience as intuitive as possible, with the fewest steps.

I have discovered there is an actual template creation feature, that I haven't tried out yet, so I'll look into that too.


author: stevedennisonfido
body: I just ran into this issue and searched a bunch of places for a resolution. My use case was basically having statuses, and wanting to filter out anything that was closed, from a particular table. It seems like the behaviour is intended/designed to not allow "not" type statements, hence it stripping it on edit, however it retains if you start the filter with a non-negative condition, followed by your negative conditions.

Example:

Text includes (this works the first time, but not on subsequent edits):

-"\|Status\|closed\|"

Text includes (this works every time):

"\|Status\|\*\|" AND -"\|Status\|closed\|"

Hope that helps anyone running into this in future.


author: Ally
body: Hi Steve.

I've tried this work around as my issue is similar 'status = complete'.

The filter did not remove my pages marked with a 'complete' status from the final page property table.

++steps I took.++

* Add filter (including text)
* tried the following
  * \|Status\|In progress\| AND -\|Status\|Complete\|
  * "\|Status\|In progress\|" AND -"\|Status\|Complete\|"
  * -"\|Status\|Complete\|"
  * -Status\|Complete
  * -Complete

Newer confluence user so perhaps I have missed what pipes and quotation marks represent.

All guidance is welcomed.


Tags: cloud

confluence-cloud

filter

macro