Skip to main content
Read Create an action before working through these examples. Each one below gives the field values for one ION Action: its title, target, and event, followed by the context query it reads and the code it runs. Stops an issue from moving to In Review while any of its redlines sit on a step that isn’t complete or canceled. The technique: read a related collection from the context and require every record in it to be in an acceptable state. Context
Code

Restrict an action to specific roles

Blocks moving an issue back to In Review from a resolved state unless the acting user holds a quality role. The technique: branch on the acting user’s roles from currentUser, and read the prior value from changes to detect the reopen. Context
Code

Check a custom attribute

Stops a part from being added to a kit when its On CAPA? attribute is set. The technique: scan a list of { key, value } attributes on a related object for a specific key. Context
Code

Require a field on every item in a collection

Blocks moving a procedure to In Review when any step has no upstream or downstream dependency. The technique: gate on a status change read from changes, then iterate the object’s child collection and require a field on each. Context
Code

Match records across a nested collection

For a Build procedure, blocks the move to In Review until reviewers from the Responsible Engineer, Production, and Mission Assurance teams have been added. The technique: flatten a nested collection (reviewers, then their teams) and confirm every required value is present. Context
Code

Require a field before a status change

Blocks a purchase order line from moving to Requested when it has no need date. The technique: gate on a status change read from changes, then require a scalar field on the object. Context
Code
To enforce purchase order approval levels, use the built-in purchase order approvals instead of an ION Action. It’s easier to configure and maintain.

Require multiple fields on creation

Blocks creating a part of type Part until the required fields are filled in. The technique: run on the CREATE event, guard on the object’s type, then check a list of required fields at once. Context
Code