Skip to content

Frameworks

Marketplace

Platform

Resources

↑↓ to moveEnter to openHelp, news and every page are found here too

Write a custom test

How to write your own test with the no-code form or the JSON editor, preview it on today's data, save a draft and ask a named person to publish it.

Updated

The tests that come with Asiri cover many controls. When you need a check of your own, write a custom test. It is a rule over your own data, for example "every laptop with a company email is encrypted". A custom test counts toward nothing until a second person publishes it.

Who can do this

Owners and Editors can write a custom test. A different Owner or Editor publishes it.

Start

Open Tests under Checks and press New custom test. The page has three tabs: No-code, Advanced JSON and Versions. You can also describe the rule in a sentence and let Eri draft it. See Ask Eri to draft a test from a sentence.

Write it with the no-code form

  1. Under The test, give it a Name, say What it checks in one or two plain sentences, and choose the controls it Counts toward.
  2. Under Read from, choose where the facts come from: a Connected account, a Register, or Pushed data.
  3. Under It passes when, choose All or Any, then add conditions. Each condition is a field, a test and a value. The tests offered depend on the field: is, contains, starts with, matches the pattern, is at least, is at most, is before, is after and is set. For a tag, choose Another field, such as a tag and type its name.
  4. If the rule needs two sources, for example buckets and the keys that protect them, use Join a second source.
  5. Press Preview on today's data.

Preview before you save

The Live preview says "Nothing is saved or sent". It reads your real data, shows how many things would pass and how many would fail, and names the failures. If it says This rule could not be judged, it tells you why. If the source is larger than one run reads, it says so.

Write it as JSON

The Advanced JSON tab shows the same rule as text. It is a small declarative language. It can compare, combine with all or any, and join a second source. It cannot run code or reach outside your own data. The page shows No code runs and Own data only.

A rule that nests conditions, or limits which records it applies to, can only be edited here. The no-code tab tells you so: "This rule is written in Advanced JSON". The two tabs always show the same rule.

Save and ask for it to be published

  1. Press Save draft. A draft counts toward nothing.
  2. Press Ask to publish.
  3. Choose Ask someone in particular if you want to. This is optional.
  4. Press Send it.

Someone else checks the rule and publishes it. Until then the test counts toward nothing. Publish, version and withdraw a custom test covers what happens next.

Common questions

Can I publish my own test? No. Someone other than the person who wrote it, and other than you if you sent it, publishes it.

Can a custom test run code? No. The rule language cannot run code or reach outside your own data.

Does a draft count toward readiness? No. Only a published version counts.

Related guides

Can’t find what you need? Contact us.