Limiting fetching of reviews through API

Quick question:  I'd like to only get the open reviews through getReviews API call, How would I write that query? 

Currently I have:

p = json.dumps({'limit':50000})
r = requests.post("<host>/~rpc/getReviews", auth=<...>,data=p)

Right now I just fetch the last 50k reviews but that's not very scalable.I couldn't really find an example in the API docs some time ago.

 

Thanks!

Devon

2 comments
Comment actions Permalink

Hey Devon,

Beside of the `limit`, you might also use `query` and `projectId`.

Please see the description here:

https://upsource.jetbrains.com/~api_doc/reference/Projects.html#messages.ReviewsRequestDTO

1
Comment actions Permalink

Hi Artem

Thanks for the swift reply, updated the fetch to:

p = json.dumps({'limit':10000,'query':'state: open'})

 

Cheers

Devon

0

Please sign in to leave a comment.