Incidents are created but when i try to open that then showing that no records found

AakashM94578595
Tera Contributor

Goal 
1 Create one incident per group member (dynamic, not hardcoded).

2 Assign each incident to a group member.

3 Short description: Daily Health Check for [Member Name].

4 Caller: A default user like "Health Check User".

5 Run only Monday to Friday, daily at a specific time.

6  called_id is system properties in which i saved specific user id
(function run() {
var myProperty = gs.getProperty('called_id');
    var today = new GlideDateTime();
    var dayOfWeek = today.getDayOfWeekLocalTime();
    if (dayOfWeek == 1 || dayOfWeek == 7) {
        return;
    }
    var group = new GlideRecord('sys_user_group');
    group.addQuery('name', 'Hardware');
    group.query();
    if (group.next()) {
        var members = new GlideRecord('sys_user_grmember');
        members.addQuery('group', group.sys_id);
        members.query();
        while (members.next()) {
            var inc = new GlideRecord('incident');
            inc.initialize();
            inc.short_description = "Daily Health Check for " + members.user.name;
            inc.assignment_group = group.sys_id;
            inc.assigned_to = members.user.sys_id;
            inc.caller_id = myProperty;
            inc.insert();
        }
    }
})();  AakashM94578595_0-1749014246845.pngAakashM94578595_1-1749014269067.png

 

 

1 ACCEPTED SOLUTION

Sanjay191
Tera Sage

Hello @AakashM94578595 

I think it working fine for me just check with incident list layout and if anything else please let me know 
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You

View solution in original post

2 REPLIES 2

Sanjay191
Tera Sage

Hello @AakashM94578595 

I think it working fine for me just check with incident list layout and if anything else please let me know 
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You

AakashM94578595
Tera Contributor

Before BR is running for same hardware group , that i forget to mark false.