---
original_url: "https://jace.pro/blog/approval-field-and-why-it-works-the-way-it-does/"
format: markdown
ai_optimized: true
---

Approval field and why it works the way it does- # Approval field and why it works the way it does

November 1, 2024 [servicenow ](/tags/servicenow/)[approvals](/tags/approvals/)

  Enable AI Animation
There’s the told approval engine that I believe evaluates the `sysrule_approvals` and `process_guide` records. There’s a number of approval rules against `sc_request`
Depending on how the `approval_engines.do` page is configured controls how the legacy approvals work. Lets look at the three tables in question;
Catalog Task is set to use Process Guides
- Requested Item using approval engine when it’s associated to a delivery plan, otherwise it’s handled in the workflow or flow.
- Request is managed by workflows only.

- Catalog Task Process Guide
Catalog Task Default ( when this condition is true `state=1^delivery_task.sys_class_name=cat_item_dt_approval`)
Today we have [9 items using DEFAULT execution plan here](https://deltasndev.service-now.com/sc_cat_item_list.do?sysparm_query=type!%3Dbundle%5Esys_class_name!%3Dsc_cat_item_guide%5Etype!%3Dpackage%5Esys_class_name!%3Dsc_cat_item_content%5Epublished_refISEMPTY%5Edelivery_planISNOTEMPTY%5Eactive%3Dtrue%5Esys_class_name!%3Dstd_change_record_producer%5EORsys_class_name%3DNULL%5Esys_class_name!%3Dsc_cat_item_producer%5EORsys_class_name%3DNULL%5Esys_class_name!%3Dsc_cat_item_composite_producer%5EORsys_class_name%3DNULL%5Esys_class_name!%3Dpc_product_cat_item%5EORsys_class_name%3DNULL&sysparm_view=).
Those invoke a call to this script include `GlideappTaskApprovalHelper` which is hidden/unavailable but is setting the approval to `requested` when there are no approvers.

- Catalog Task Business Rules
Auto Close on Approval - This is used on Execution Plan tasks and sets the `active` and `work_end` fields.
- Reject Parent - This is used on Execution Plan tasks and sets the `sc_req_item.approval` based on the `sc_task` if it’s rejected.

- Task Business Rules
Stamp Approvals - This sets `approval_set` to the current time when approved or rejected, otherwise it clears the value.
- Moot Approvals Upon Cancellation - This looks at all individual and group approvals for the current task, if the state of the `sysapproval_approver` or `sysapproveral_group` are `requested` or `not requested` this sets’ the approval record to `not_required`.
- task events - This generates events that notifications and script actions can trigger against.
`task.approved` - no script actions against this
- `task.rejected` - no script actions against this

- Requested Items Approval Engines - [There are none](https://deltasndev.service-now.com/sysrule_approvals_list.do?sysparm_query=active%3Dtrue%5Etable%3Dsc_req_item&sysparm_view=).
- Requested Items Workflows ([KB0538552](https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0538552))
`Approval Action` - Sets the approval as configured.
- `Approval - User` - Sets approval to Requested, and then Approved or Rejected as configured.
- `Approval - Group` - Sets approval to Requested, and then Approved or Rejected as configured.
- `Rollback To` - Sets approval to Not Yet Requested or Requested as configured.

- Requested Items Flows
`Ask for Approval` - Sets the approval to Requested, and then Approved or Rejected as configured.

- Requested Items Business Rules
Items Added After Request Approved - runs **before insert**, where **`current.request.approval == approved and current.stage == waiting_for_approval`**
Then if the catalog item associated uses workflow or flow, set the **`current.approval = requested`**
Else, **`current.approval = current.request.approval`**
- Set RITM Due Date On Insert - calculates the `due_date`
- request item closure - cancels related approvals when the item becomes cancelled
- sc_ic: Copy Approval Definitions - This calls `sc_ic_Factory` which [deals with the catalog item designer](https://docs.servicenow.com/bundle/vancouver-servicenow-platform/page/product/service-catalog-management/reference/r_InstalledWithCatalogItemDesigner.html).
- reject approval on closed incomplete - runs **before insert or update** where **`current.state.changesTo(4)`**
Then it sets the approval to rejected.

- Request Workflows
2. Service Catalog Request **active == true** (`no condition`) set’s `approval` to `requested` then **Marks task approved**
5. Source Request **active == false** (`sourceable=true^approval=approved^EQ`)
6. Service Catalog Request **active == false** (`no condition`)
7. Delta Hardware Catalog Generic **active == false** (`parent.ref_sc_req_item.cat_item.category!=<hardware/software procurement^EQ`)
- Request Business Rules
request closure - this appears to cancel related approvals by calling `SNC.Request` but that code is not accessible.
- Set Request State - this sets the `sc_request.stage` and `sc_request.state`.
- Cascade Request Approval to Request Item - runs **after insert or update** where **current.approval.changes()**
if the item is a sequenced request item, sets the stage to not started
else cascade the approval to the request item, which works differently for workflow, flow and delivery plan
workflow if current.hasWorkflow, if (stage is `waiting_for_approval` or is sequenced item) and request.approval == approved, current.approval = `requested`, else `rejected`
flow if current.hasFlowDesigner, if (stage is `waiting_for_approval` or is sequenced item) and request.approval == approved, current.approval = `requested`, else `rejected`
delivery plan copies the approval from the request.approval
- sc request events - triggers events - look for script actions
sc_request.approved - no script action
- other events not applicable

---
[View this page on GitHub](https://github.com/jacebenson/jace.pro/tree/main/./src/posts/2024/2024-11-01-approval-field-and-why-it-works-the-way-it-does.md).

[Approval field and why it works the way it does](https://jace.pro/blog/approval-field-and-why-it-works-the-way-it-does/) [Jace Benson](https://jace.pro) ![Jace Benson](https://jace.pro/icon-512x512.png)

---

*This content is from Jace Benson's ServiceNow and tech blog at jace.pro*
*Original post: https://jace.pro/blog/approval-field-and-why-it-works-the-way-it-does/*
