How to get correct number of watched pages for current user?

Volodymyr Batrukh May 14, 2020

Hi, 

According to documentation https://developer.atlassian.com/cloud/confluence/cql-fields/#watcher, we can get list of watched pages for the user by calling:

/rest/api/search?cql=watcher=currentUser()

But it is showing the incorrect number of pages. E.g. user is watching 10 pages, the API call returns 10 results. When user started to watch new page the API returns 11 results. And that is expected behavior. But once user stopped watching the page, the API still returns 11 pages/results, so the response is never decreased.

Is it known issue?

Another issue I faced with - watcher=currentUser() is not returning pages from the watched space. The same issue was mentioned here.

How to get all the watched pages for the user (directly watched and all pages from the watched space)?

1 answer

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 20, 2020

Hello @Volodymyr Batrukh !

I tried the REST call mentioned in our documentation and was able to reliably replicate this behavior.

With such results, I created the following bug report:

Since there is no workaround, the best course of action would be to vote and watch the report. Voting helps to increase the report visibility and watching it will keep you up to date with everything posted there!

 

Let us hear from you!

Volodymyr Batrukh May 21, 2020

Hi @Diego ,

Thanks for creating a ticket for the issue.
Could you please also reference in Jira that the API method is returning only directly watched pages, but not pages from watched space?

Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2020

Thanks for reporting this behavior as well! I would like to ask a few questions to you @Volodymyr Batrukh :

 

  1. Is the API returning you as the watcher of the space as a whole?
  2. Is the “watcher” counter increased by one or is it not increased at all?
  3. Is the API not returning all pages within a space as watched content?
Volodymyr Batrukh May 27, 2020

Hi @Diego ,

The API is not returning pages from watched space at all. So if for example a user is watching three pages (by openeing page directly and selecting "Watch page") and one space ( user opened space and selected "Watch all content in this space") with five pages in it - the API will return just 3 results (3 directly watched spaces). Expected result is 3 + 5 pages. So I would expect to see all watched content by calling /rest/api/search?cql=watcher=currentUser()

josef
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2024

Bug where reindex was not triggered on unwatch should be fixed now

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events