Skip to content

Reviews

mash.reviews · Platform

Needs feature: reviews

Ask a person to review a file, from a script

reviews.available() → bool

Whether this tenant has Reviews, so a script can carry on without it instead of failing on request(): if mash.reviews.available() ... end.

reviews.request(file: mixed, reason: mixed, options?: array) → array

Ask for a review of a file.

mash.reviews.request(file, “Redacted copy: check before release”, {code: “health-redaction”}) mash.reviews.request(file, “Over the limit”, {rule: “Finance sign-off”})

reason is what the reviewer reads (plain text, at most 500 characters). code is this script’s own id for the ask (default “script”). One request stays open per file, script and code: asking again while it is open refreshes the reason and raises nothing new, and a different code raises another. rule names a review routing rule (name or id); when it is missing or does not apply to the file’s share the usual routing is used, and with no rule that applies the default reviewers get it. The person who started the run is not asked to review it. The script’s owner must be able to read the file.

Returns {id, created, status}: created is false when an open request was refreshed.

reviews.status(file: mixed, code?: string) → string

The status of this script’s request on a file: “pending”, “approved”, “rejected”, “cancelled” or “expired”, or null when it has asked nothing (for that code; default “script”) about that file.