Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

List of all watched questions using REST API

Berry Kersten
Contributor
June 16, 2020

Hi, 

I have a use case where I want to query all watched questions for a specific user (using the REST API), but I'm not sure how to do this.

For example: all watched questions for user sysadmin

https://www.someurl.com/rest/api/latest/search?type=question&cql=watcher+=+sysadmin&maxResults=100&startAt=0

The result is not satisfying as it also displays pages.

Ideas anyone?

Thanks!

1 answer

0 votes
Lasse Langhorn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2020

Hi @Berry Kersten 

I have not played with Questions for Confluence as I assume that is what you are using.

According to the Confluence REST API field reference for type question is not supported but then I guess this type will be available when this module is installed in Confluence.

But have you tried something like this where you omit the type parameter?              

https://www.someurl.com/rest/api/latest/search?cql=watcher+=+sysadmin+and+type!=page&maxResults=100&startAt=0
Regards

Lasse Langhorn

Berry Kersten
Contributor
June 17, 2020

Hi @Lasse Langhorn Thanks for your reply!

Correct, I'm using Questions for Confluence (and the corresponding documentation on https://docs.atlassian.com/confluence-questions/rest/resource_SearchResource.html)

Based on your answer I've tried the following:

https://www.someurl.com/rest/questions/1.0/search?type=question&cql=watcher+=+sysadmin&maxResults=100&startAt=0Regards

And this still does not seems to work as it's returning questions I'm (sysadmin) not watching.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events