Useful approval assignment scripts
-
- UpdatedAug 3, 2023
- 5 minutes to read
- Vancouver
- API implementation
This is a searchable version of the useful approval and assignment scripts.
For an easy-to-navigate version, visit the Useful Scripts portal.
Assign a group for ESS requests
Type: Assignment Rule
Description: This script automatically assigns a group for all ESS Requests.
Script example:
Assign Catalog Item to Group Based on Delivery Plan Task
Type: Assignment Rule
Assign items with one task
Type: Assignment Rule
Assignment based on workload
Type: Business Rule
Description: opulate the assigned to based on the assignment group member who has the least amount of active incidents.
- order: >1000 if you want to execute after assignment rules
- condition: current.assigned_to == '' && current.assignment_group != ''
- when: before, insert/update
Run assignment rules when category is changed
Type: Client script
Table: Incident
Custom approval UI macro
Type: UI macro
- Navigate to System UI and click UI Macros.
- Rename the existing "approval_summarizer_sc_task" to something like "approval_summarizer_sc_task_old" and deactivate it.
- Create a new one using the same name ("approval_summarizer_sc_task"). The name should basically tell you what the macro does and to what it applies. In this case, we're replacing an existing one so we decided to re-use the existing name.

Then copy the xml script at the bottom of this article into the xml code window in the new UI Macro. This is great way to give some detail to an approver when you are doing line item approvals using approval tasks within the Service Catalog Execution Plans.
Different ways
Old way
This is the view you see in My Approvals when using an approval task using the old method.

Notice there is not much detail telling the approver what they are actually approving. You can see the short description of the task but not much information about the item .
New way
This is the view you will see if you use the xml script below in place of the OOB (out-of-box) UI Macro.

Using this method you can see details much like the request approval. You have a link into the item ordered, a short description (which contains the ability to expand the variables from the item), price, quantity and the total price. This helps the approver in that it shows more detail. They can now see what they are actually approving.