Marking review as "Submitted" using API

11 views
Skip to first unread message

Hovanes

unread,
Oct 20, 2008, 8:58:59 PM10/20/08
to reviewboard
Hello All,

I was wondering if there is a way to mark a review as Submitted using
the JSON API.

I have read the API documentation and cannot find any method to do
this.

Thanks in advance,

Hovanes

Christian Hammond

unread,
Oct 20, 2008, 9:04:26 PM10/20/08
to revie...@googlegroups.com
Not yet but I have an upcoming change that will introduce this. It will be part of a larger UI restructuring, but maybe I can pull this out and make it available sooner.

Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.

Lemuel Typhair

unread,
Oct 20, 2008, 9:28:56 PM10/20/08
to revie...@googlegroups.com
Please do.

--
ltyphair

Augie Fackler

unread,
Oct 20, 2008, 9:46:50 PM10/20/08
to revie...@googlegroups.com

On Oct 20, 2008, at 8:04 PM, Christian Hammond wrote:

> Not yet but I have an upcoming change that will introduce this. It
> will be
> part of a larger UI restructuring, but maybe I can pull this out and
> make it
> available sooner.

When this goes in, I'll see if I can cook up a post-commit-hook that
should be able to automatically mark reviews as submitted upon commit.

H M

unread,
Oct 22, 2008, 6:46:10 PM10/22/08
to revie...@googlegroups.com
Attached is a snippet of Perl I came up with to set the ReviewRequest as "Submitted" using SQL. I know this is probably not a desired way to do it, but it worked for us.

If there is any use for this, I can tidy it up a bit and submit it to the project.

Hovanes
SetSubmitted.pl

Christian Hammond

unread,
Oct 22, 2008, 6:51:55 PM10/22/08
to revie...@googlegroups.com
There's an API command up for review that will be in today which allows you to easily mark a review request as submitted. See http://reviews.review-board.org/r/604/


Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.


sub SetSubmitted($) {
       my $ReviewId = shift;
       # Connect to the database.
       my $dbh = DBI->connect("DBI:mysql:database=".$DBNAME.";host=".$DBHOST, $DBUSER, $DBPASS, { RaiseError => 1} );

       # Set status to Submitted
       my $sth = $dbh->prepare( "UPDATE reviews_reviewrequest SET status='S' WHERE id=?" ) or do
               {
                       print STDERR "Couldn't prepare statement: " . $dbh->errstr, "\n";
                       return 0;
               };

       $sth->execute( $ReviewId ) or do
               {
                       print STDERR "Couldn't execute statement: " . $sth->errstr, "\n";
                       return 0;
               };
       return 1;

}


H M

unread,
Oct 22, 2008, 6:57:51 PM10/22/08
to revie...@googlegroups.com
Great! Thanks.
Reply all
Reply to author
Forward
0 new messages