Hi Erik and Christian,

Thanks so much for your answers.

Yes indeed what I was looking for was to use the "submit_as" option.

Initially I tried it with the draft.update function. But from my 
experiments it looks like it has no effect there, either my first option my 
using "submitter" or "submit_as".

However I managed to get it to work specifying it on the creation, as 
pointed out on the bit of documentation brought up by Erik.

So just to make it clearer for other people, use the "submit_as" option 
during the creation of the review, not when modifying the draft:

# Create the review
review_request = root.get_review_requests().create(repository=repository,
                                                   submit_as='real_user1')

Further down you would change the reviewers this way:

draft = review_request.get_draft()
draft = draft.update(
    summary='API tutorial request',
    description='This request was created in the API tutorial.',
    target_people='real_user2')

Thanks so much!


On Tuesday, March 21, 2017 at 8:38:18 PM UTC, Christian Hammond wrote:
>
> Yep, this is what you need. You'll need your automation user to have the 
> "can_submit_as" permission enabled as well.
>
> Christian
>
> -- 
> Christian Hammond
> President/CEO of Beanbag <https://www.beanbaginc.com/>
> Makers of Review Board <https://www.reviewboard.org/>
>
> On Tue, Mar 21, 2017 at 1:35 PM, Erik Johansson <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> Without knowing much about this I would guess you need to set submit_as 
>> when creating the review request. See 
>> https://www.reviewboard.org/docs/manual/2.5/webapi/2.0/resources/review-request-list/#POST
>>
>> // Erik
>>
>> On 21 March 2017 at 10:21, mav14117 <[email protected] <javascript:>> 
>> wrote:
>>
>>> Hi there,
>>>
>>> I am using the Python API to create a new review. 
>>>
>>> My main goal is to create a review with an automation user, eg, jenkins, 
>>> but make the submitter and the reviewers real users.
>>>
>>> I was following the tutorial and I thought I could do something like 
>>> this:
>>>
>>> # Modify the review
>>> draft = review_request.get_draft()
>>> draft = draft.update(
>>>     summary='API tutorial request',
>>>     description='This request was created in the API tutorial.',
>>>     submitter='real_user1',
>>>     target_people='real_user2')
>>>
>>> draft.update(public=True)
>>>
>>> However this seems not to have any effect, since the reviews are created 
>>> with my "jenkins" user instead.
>>>
>>> I tried searching for different terms, including "python submitter" and 
>>> "python api submitter" but this did not throw back any relevant threads. 
>>>
>>> Can anyone offer some directions on how could I achieve this?
>>>
>>> Many thanks!
>>>
>>>
>>> -- 
>>> 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 [email protected] <javascript:>.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Erik Johansson
>> Home Page: http://ejohansson.se/
>> PGP Key: http://ejohansson.se/erik.asc
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to