Can someone please help with the perforce (p4v) command to fetch Swarm review id corresponding to a change list for which swarm review is raised already.
Asked
Active
Viewed 940 times
1 Answers
1
You can get the review for a change with the swarm api: https://www.perforce.com/manuals/swarm/Content/Swarm/swarm-apidoc_endpoint_reviews.html#Get_List_of_Reviews
There's no p4vjs method if that was what you were asking.

J Brown
- 396
- 1
- 4
-
In Perforce there is a column Review id . I need to fetch that review id field corresponding to a shelved cl for which swarm review is already raised. If review is not raised , review id field will be empty for that particular shelved cl. – Sony M George May 13 '21 at 01:07
-
Right. P4V calls the swarm api to get that: – J Brown May 13 '21 at 22:47
-
For example, change 31: http://swarm/api/v9/reviews/?fields=id,changes,stateLabel&change[]=31 Parse the return json. {"lastSeen":32,"reviews":[{"id":32,"changes":[31,33],"stateLabel":"Needs Review"}],"totalCount":1} the reviews id column is your review - in this case 32. There may be more than one review for the change. – J Brown May 13 '21 at 22:55