UI Action Script to Populate Story with checklist items from Enhancement Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2025 02:43 PM
I am tasked with creating or rather "updating" a current UI action.
It's for our "create a story" UI action from an enhancement record.
Our BAs will create a checklist on the enhancement record (it will not be a template and will be specific to each enhancement).
Upon the Create a Story UI action, I need the checklist item that were on the Enhancement record to populate to the Story checklist.
Any ideas now to achieve this?
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 03:35 AM
Hey Kathy,
I'd likely refactor this, but in terms of your checklist requirement - you need to also copy the checklist items
var checklistGR = new GlideRecord('checklist'); // Assuming the checklist table is 'checklist'
checklistGR.addQuery('table_sys_id', current.sys_id); // Get checklist items for this enhancement
checklistGR.query();
while (checklistGR.next()) {
var existingCheckListID = checklistGR.getUniqueValue();
//Copy checklist
checklistGR.setValue('table' , story.getTableName());
checklistGR.setValue('document' , story.getUniqueValue());
var newCheckList = checklistGR.insert();
if(!newCheckList){
gs.error("Failed to copy checklist " + checklistGR.getLastErrorMessage());
return;
}
//Copy checklist items
var checkListItems = new GlideRecord('checklist_item');
checkListItems.addQuery('checklist', existingCheckListID);
checkListItems.query();
while(checkListItems.next()){
checkListItems.setValue('checklist' , newCheckList);
checkListItems.insert();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 01:01 PM
this is getting me there, but not quite. It is pulling over checklist items that are not associated to enhancement record created story from.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 01:37 PM
this almost has me there, but it is pulling over checklist items that are not associated with the enhancement record I was on when initiated the create a story UI action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 03:14 AM
Check existingCheckListID has a valid value, otherwise when the following script attempts to run, it won't correctly filter the checklist item table
//Copy checklist items
var checkListItems = new GlideRecord('checklist_item');
checkListItems.addQuery('checklist', existingCheckListID);
checkListItems.query();
while(checkListItems.next()){
checkListItems.setValue('checklist' , newCheckList);
checkListItems.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 10:33 AM
Finally got story completed. For some reason, I could not get script provided to work (likely user error on my end) 🙂
I did find a BR script that copied checklist over from a demand to a project; made some modifications, and it worked.
Thanks so much for your assistance!