What is the best way to get the status of the review request automatically

220 views
Skip to first unread message

Sam

unread,
Nov 2, 2015, 10:02:21 PM11/2/15
to reviewboard
Hello,

What is the best way to get the status of the request as if it is marked as "Submitted", "Ship it", "Pending".

What I have found is :

 rbt api-get http://reviewboard.com/api/review-requests/110 --status=submitted

But this gives me all the attributes of the request.

How do I get just the status for the specific request id? what is recommended way to query the request and get specific field?





David Trowbridge

unread,
Nov 3, 2015, 5:47:36 PM11/3/15
to reviewboard
There's no way to get a response that only includes a single field's contents--it will always be formatted as JSON or XML. However, if you'd like to reduce the amount of data that gets sent, you can limit it using /api/review-requests/110/?only-fields=status

-David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sam

unread,
Nov 3, 2015, 8:37:09 PM11/3/15
to reviewboard
Thanks for quick reply.
I tried the following and it still return all the field


rbt api-get http://reviewboard.com/api/review-requests/110/?onlyfield=status
{"stat": "ok", "review_request": {"status": "pending", "last_updated": "2015-10-28T21:51:08Z", "target_people": [{"href": "http://reviewboard.com/api/users/gang/", "method": "GET", "title": "gang"}], "depends_on": [], "description_text_type": "markdown", "testing_done_text_type": "markdown", "ship_it_count": 1, "close_description_text_type": "plain", "id": 110, "links": {"diffs": {"href": "http://reviewboard.com/api/review-requests/110/diffs/", "method": "GET"}, "repository": {"href": "http://reviewboard.com/api/repositories/1/", "method": "GET", "title": "engn"}, "changes": {"href": "http://reviewboard.com/api/review-requests/110/changes/", "method": "GET"}, "self": {"href": "http://reviewboard.com/api/review-requests/110/", "method": "GET"}, "update": {"href": "http://reviewboard.com/api/review-requests/110/", "method": "PUT"}, "last_update": {"href": "http://reviewboard.com/api/review-requests/110/last-update/", "method": "GET"}, "reviews": {"href": "http://reviewboard.com/api/review-requests/110/reviews/", "method": "GET"}, "draft": {"href": "http://reviewboard.com/api/review-requests/110/draft/", "method": "GET"}, "file_attachments": {"href": "http://reviewboard.com/api/review-requests/110/file-attachments/", "method": "GET"}, "submitter": {"href": "http://reviewboard.com/api/users/sam/", "method": "GET", "title": "sam"}, "delete": {"href": "http://reviewboard.com/api/review-requests/110/", "method": "DELETE"}, "screenshots": {"href": "http://reviewboard.com/api/review-requests/110/screenshots/", "method": "GET"}, "diff_context": {"href": "http://reviewboard.com/api/review-requests/110/diff-context/", "method": "GET"}}, "changenum": null, "bugs_closed": [], "testing_done": "none", "close_description": null, "text_type": null, "time_added": "2015-10-28T21:49:37Z", "extra_data": {"calculated_trophies": true}, "public": true, "commit_id": null, "blocks": [], "description": "demo3", "issue_resolved_count": 0, "issue_open_count": 0, "branch": "temp_mojgans_db2_main_rbtool", "approved": true, "url": "/r/110/", "absolute_url": "http://reviewboard.com/r/110/", "target_groups": [], "summary": "demo3", "issue_dropped_count": 0, "approval_failure": null}}


Barret Rennie

unread,
Nov 3, 2015, 8:37:55 PM11/3/15
to revie...@googlegroups.com
Hi Sam,

The syntax is "only-fields", not “onlyfield"

Regards,
Barret
Reply all
Reply to author
Forward
0 new messages