Jump to content


How to add a list of reviewers to a SWARM review

reviewers

  • Please log in to reply
2 replies to this topic

#1 ivy

ivy

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 10 August 2017 - 11:19 AM

Hello,


As mentioned in SWARM API page, a list of reviewers can be passed when creating a new review (using POST /api/v2/reviews/)
https://www.perforce...ws.createReview

However, when I pass a list of several users, it shows the error: "error":"Bad Request","details":{"reviewers":"Unknown user id(s) ...
curl -u "user:password" -d"change=12067560" -d"reviewers=lam.bich,anh.truong" http://swarmhost/api/v1.1/reviews/

or it only sends the review to the last person in the list.
curl -u "user:password" -d"change=12067560" -d"reviewers=lam.bich" -d"reviewers=anh.truong" http://swarmhost/api/v1.1/reviews/

Can anyone tell me what is the problem and what is the correct syntax to pass a list of reviewers?

Thanks in advance.

#2 P4Dale

P4Dale

    Member

  • Staff
  • 14 posts

Posted 16 August 2017 - 07:39 AM

Hello Ivy,

Please try adding [] before the equals signs on each of the reviewers in your second example.

Quote

curl -u "user:password" -d"change=12067560" -d"reviewers[]=lam.bich" -d"reviewers[]=anh.truong" http://swarmhost/api/v1.1/reviews/

Hope this helps you.

Regards,

Dale.

#3 ivy

ivy

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 23 August 2017 - 08:59 AM

Hi Dale,

Thank you a lot, it works ^^. You save me!



Also tagged with one or more of these keywords: reviewers

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users