Associate Checklist for a Request depending on Resource/UDF Values

Associate Checklist for a Request depending on Resource/UDF Values

Requirement:
Script to associate checklists depending on UDF Additional field values/Resource Question values.

Usecase:
In few organizations. they have a separate template for "New Asset Request". 
Each new asset needs a different set of checklists to be followed before delivering the asset to the requester.
Depending on the values chosen, the respective checklist has to be associated with the request.

Requirement 1:  For a single Asset Request
Case 1: This value can be maintained as a Request Picklist Additional Field
Case 2: This value can be maintained as a Resource - Dropdown Question

Requirement 2:  For multiple Asset Request
Case 3: These values can be maintained as a Resource - Checkbox Question
Case 4: These values can be maintained as a Request Multiselect Field

Steps to configure:
1.  Download the attached scripts.  Copy the contents into Request custom functions.

2.  Goto Admin > Request Custom Function > Global Function > New > Paste the global function contents and save it with a name.
(Update the SDP configurations details in the global function)


3.  Goto Admin > Request Custom Function > Custom Function > New > Paste the customfunction.txt content and save it with a name
(Update the global function count according to your instance and the checklist values)‚Äč


4.  Configure the created custom function in a trigger to get executed every time a Service Request is created, with certain criteria.


Note:
  1. Update the mapping for the Checklist values within the script.
  2. From CustomFunction.zip, use the function as per your requirement.