# Quality Examples

To ensure data accuracy in non-conformance workflows, follow these example rules. These guidelines emphasize capturing data before proceeding to subsequent steps.

<details>

<summary>Issue Must Have an Assignee Before Being Submitted for Review</summary>

```
mutation {
  createRule(input: {
    title: "Issue Must Have an Assignee Before Being Submitted for Review.",
    target: ISSUEAPPROVALREQUEST,
    ruleType: VALIDATION,
    eventType: CREATE,
    enabled: true,
    context: "{\n  issueApprovalRequest(id: $id) {\n    id\n    issue {\n      status\n      assignedTo {\n        id\n      }\n    }\n  }\n}",
    code: "issue_approval_request = context.get('issueApprovalRequest') or {}\nissue = issue_approval_request.get('issue') or {}\nstatus = issue.get('status')\nassigned_to = issue.get('assignedTo')\n\nif status in ['PENDING', 'IN_PROGRESS'] and assigned_to is None:\n    raise ValidationError()\n",
    errorState: BLOCK
  }) {
    rule {
      id
    }
  }
}
```

</details>

<details>

<summary>Cause Condition, Expected Condition, and Disposition text must be populated before moving through review.</summary>

```
mutation {
  createRule(input: {
    title: "All Issue Text Fields Must Be Filled In Before Requesting Reviews",
    target: ISSUEAPPROVALREQUEST,
    ruleType: VALIDATION,
    eventType: CREATE,
    enabled: true,
    context: "{\n  issueApprovalRequest(id: $id) {\n    id\n    issue {\n      status\n      causeCondition\n      expectedCondition\n      disposition\n    }\n  }\n}",
    code: "def has_text(node):\n    return bool(\n      node.get('text')\n      or any(has_text(child) for child in node.get('children') or [])\n    )\n\nissue_approval_request = context.get('issueApprovalRequest') or {}\nissue = issue_approval_request.get('issue') or {}\nis_status_ok = issue.get('status') in ['PENDING', 'IN_PROGRESS']\n\nif is_status_ok:\n  disposition = issue.get('disposition', [])\n  expected_condition = issue.get('expectedCondition', [])\n  cause_condition = issue.get('causeCondition', [])\n  \n  if (\n    not disposition\n    or not expected_condition\n    or not cause_condition\n    or not any(has_text(d) for d in disposition)\n    or not any(has_text(d) for d in expected_condition)\n    or not any(has_text(d) for d in cause_condition)\n  ):\n    raise ValidationError()\n",
    errorState: BLOCK
  }) {
    rule {
      id
    }
  }
}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual-v2.firstresonance.io/os/ion-actions/quality-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
