Forum Discussion

Dale's avatar
Regular Visitor
6 years ago

How to access review files vai JSON or the CLI Client

I have a case where I need to run a 3-rd party tool in order to provide a textual diff of some binary files. Files are stored in Bitbucket and a Collaborator review is created when a pull request is made.


I'd like to insert the textual diff as a file into the peer review, triggered by the Added File Trigger. In that trigger, I'd need to get all the files that were added, identify which ones were the custom binary files and then download the last two versions and send it to the 3-rd party diff tool. The result of that diff will be added as a new file into the reivew. I will potentially need to scan old reviews or reviews where the Added File Trigger failed to add the diff, and so a JSON or cli client solution would be ideal, rather than just relying upon the Added File Trigger variable substitutions.

I've been unable to identify any way of getting a list of files via JSON or the CLI client, nor any JSON or CLI client commands to retrive files.  Does anybody have any suggestions on how to accomplish this? Theoretically, if I had enough information, I could go to git and collect data from it, however, the files already exist on the Collaborator server, and having to download the git repository for every changeset / Added File Trigger seems excessive.


Thank you

No RepliesBe the first to reply