- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 09:02 PM
Dear Experts,
I have a scenario to implement an exit clearance checklist in ServiceNow HRSD. Employees and other teams like IT, Security, Employee Manager should complete the exit clearance checklist. The idea is to create an HR Case, create parallel HR Tasks [automatically using the Service Activity] and assign it to the relevant stakeholders to complete, Close the case automatically once all the tasks are completed. There are a few checklist items that each stakeholder needs to perform, like, "Received the locker keys", "Received the laptop" etc. I am looking for an option to configure the checklist for HR Tasks so that it is prepopulated [From the template] when an HR Task is created.
Please advise on how to implement this or is there a better way of doing this?
Best,
Gowdash
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 09:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 09:06 PM
You should be able to add checklist for HR Task using this link
Follow the steps
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 09:14 PM
refer this link as well
Checklists in HR cases and tasks
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 10:20 PM
Ensure you are in HR Core scope
Steps
1) visit checklist_template.LIST table
2) create new HR Task checklist with the questions you require
3) Then create UI formatter for HR Task table
4) Configure form layout for HR Task and add the checklist on the form
5) Then create Before insert BR on HR Task with proper condition and it would attach the checklist to HR Task record
Template for JSON
{
"name": "HRTaskChecklist",
"items": [
{
"name": "Please fill email",
"order": "1"
},
{
"name": "Please fill phone",
"order": "2"
}
]
}
BR Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var task = current.sys_id;
var table = current.getTableName();
var template = getTemplate('HR Task Checklist'); // name of the Checklist
generateChecklist(template, table, task);
})(current, previous);
function getTemplate(name){
var grTemplate = new GlideRecord('checklist_template');
grTemplate.get('name',name);
return grTemplate.template;
}
function generateChecklist(template,table,task) {
var json = new global.JSON();
var itemJSON = json.decode(template);
var name = itemJSON['name'];
var items = itemJSON['items'];
var owner = itemJSON['owner'];
var checklistId = '';
var grList = new GlideRecord('checklist');
grList.addQuery('document', task + '');
grList.addQuery('table', table);
grList.query();
if (!grList.next()) {
grList.document = task + '';
grList.name = name;
grList.owner = owner;
grList.table = table;
checklistId = grList.insert();
for (var i = 0; i < items.length; i++) {
var grItem = new GlideRecord('checklist_item');
grItem.checklist = checklistId;
grItem.complete = false;
grItem.name = items[i]['name'];
grItem.order = items[i]['order'];
grItem.insert();
}
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 09:11 PM