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

How do I create a review with review items remotely?

JamieA
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.
July 7, 2011

This is driving me crazy. I have created a review programatically using the REST API. How I just want to add the files in a single change list as review items.

Do I need to add all the files individually?

Do I need to specify the previous revision?

Do I need the 40-char or the shorter 12-char changelist ID for mercurial?

Or do I actually need the csid as specificed in the docs, eg 0:25bc828a0cb3 ?

If I try this

        http.request(Method.POST, ContentType.XML) {
uri.path = "/fisheye/rest-service/reviews-v1/$permaId/reviewitems"
requestContentType = ContentType.XML
body = {
reviewItem {
fromPath ('/foo.c')
toPath ('/foo.c')
repositoryName (pkey)
fromRevision ('0:48ed3a16e563')
toRevision ( '1:ce2c82c45188')
}
}
}

I get: Can't create an frx from a null cruciblerevision

Same without the initial rev ID.

I can accomplish more or less what I want with http://host/fisheye/cru/create?csid=25bc828a0cb3&repo=HJK&projectName=CR-HJK but I want to do it via REST.

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Chii
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2011

you can POST to the url /rest-service/reviews-v1/{review-perma-id}/addChangeset with the following xml

<AddChangeset>
   <repository>repositoryName</repository>
   <Changesets>
      <repository>repositoryName</repository>
      <ChangesetData>
         <id>dac7138227955ed28220d7dd992dc16e393917cc</id>
      </ChangesetData>
      <ChangesetData>
         <id>dac7138227955ed28220d7dd992dc16e393917cc</id>
      </ChangesetData>
      <ChangesetData>
         <id>dac7138227955ed28220d7dd992dc16e393917cc</id>
      </ChangesetData>
   </Changesets>
</AddChangeset>

TAGS
AUG Leaders

Atlassian Community Events