Dynamic checklist based on field values

Dynamic checklist based on field values

Requirement:
Based on the answers provided for resource questions / request additional fields, dynamically a checklist has to be associated to the request

UseCase:
When an alarm is received indicating an issue with a server’s performance, with the details of it we can determine if the issue is related to CPU, RAM or HDD
Now when technicians manually creates an incident for the alarm, they can use ‘System Incidents’ template and choose ‘Server Performance’ as the category.
In the resource section, they can choose CPU, RAM, or HDD depending on the issue. Now if the technician chooses HDD, then HDD related checklist will be associated to the incident.  Similarly, it will happen for the other choices as well.
  
This can either be handled with resource questions or additional fields.  Attached are both versions, and can be used depending on your requirement.
  1. Request - Additional Field:
    1. associateChecklist_checkbox_requestUDF.txt
    2. associateChecklist_dropdown_requestUDF.txt
  2. Request - Resource Question:
    1. associateChecklist_checkbox_resourceQues.txt
    2. associateChecklist_dropdown_resourceQues.txt

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 URL and integration/technician key in the script. 
  1. For builds over 11300, you can get the integration key under Admin > Integrations > Integration Key > New
  2. Please use an integration key with admin privilege, as there wont be any role based permission issues. 

  3. For builds prior to 11300, refer https://help.servicedeskplus.com/api/rest-api.html$key and update the technician key.
3.  Goto Admin > Request Custom Function > Custom Function > New > Paste the associateChecklist.txt content and save it with a name
Update the global function count according to your instance

4.  Update the value and checklist id as per your requirement.
Where Laptops, Iphones, Ipads refers to the values and 1,2,3 are the checklist ids.
  1. checkList_Mapping = {
  2. "Laptops":"1",
  3. "iPhones":"2",
  4. "iPads":"3"
  5. };

5.  Configure this in a custom trigger to get invoked every time the request is created. (Invoking Condition can be modified as per your requirement.)


                  New to ADSelfService Plus?