Attribute Examples
Current Status: Available in Customers Sandbox Environments
Controlling Attribute Population at Creation
mutation {
createRule(input: {
title: "Must Have Pedigree Populated at Run Creation",
target: RUN,
ruleType: VALIDATION,
eventType: CREATE,
enabled: true,
context: "{\n run(id: $id) {\n attributes {\n key\n value\n }\n procedure {\n type\n }\n }\n}",
code: "run = context.get('run', {})\nproc_type = ((run.get('procedure') or {}).get('type') or '').upper()\n\nif proc_type == 'BUILD':\n pedigree_val = next(\n (a.get('value') for a in run.get('attributes', [])\n if a.get('key') == 'Pedigree'),\n None, # use None as the default\n )\n\n # Missing if it’s None **or** empty/whitespace\n if pedigree_val is None or not str(pedigree_val).strip():\n raise ValidationError()\n\n\n\n",
errorState: BLOCK
}) {
rule {
id
}
}
}Last updated
Was this helpful?

