Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

What is an API to get list of all spaces that current user is watching?

Anuja Deshpande
Contributor
January 29, 2020

What is an API or cql to get a list of spaces that the current user is watching?

1 answer

0 votes
Sven Schatter _Lively Apps_
Atlassian Partner
January 29, 2020

Hi @Anuja Deshpande,

have you tried this:

https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=watcher=currentUser()

EDIT: Oh, this returns all pages the user is watching, not all spaces. I'm not sure whether you can actually get all watched spaces directly. But maybe you can use the result of this CQL, to gather all spaces that the current user is watching pages in and after that check all the spaces against the space watchers API. But then you could also probably just get all spaces and loop over them directly. Might even be faster, depending on the amount of spaces.

Cheers,
Sven

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events