I want to create a report listing incidents created by members of a specific group.

ayano
Giga Guru

I want to create a report listing incidents created by members of a specific group.

To do this, I'm creating "Dynamic Filter Options."

ayano_0-1745219353494.png

ayano_2-1745219396343.png

ayano_1-1745219367624.png

However, the above settings do not work...
Do you know why? I'd appreciate any advice.

1 ACCEPTED SOLUTION

J Siva
Tera Sage

Hi @ayano 
Create one client callable script include and add your logic there. PFB the sample dynamic filter.

Script include:

Note: Remove the  Object.extendsObject(AbstractAjaxProcessorfrom your script include.

JSiva_0-1745222306865.png

var oneOfOCCGroupMembers = Class.create();
oneOfOCCGroupMembers.prototype = {
initialize: function() {},
getUser: function() {
    var userArr = [];
    var group_mem = new GlideRecord('sys_user_grmember');
    group_mem.addQuery("group.name", "Help Desk"); //REPLACE WITH YOUR GROUP NAME
    group_mem.query();
    while (group_mem.next()) {
        userArr.push(group_mem.getValue('user'));
    }
    return userArr;
},
type: 'oneOfOCCGroupMembers'
};

 

Dynamic filter option:

JSiva_1-1745222390567.png

new global.oneOfOCCGroupMembers().getUser()

 

Regards,
Siva

 

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@ayano 

please use client callable script include for this and not business rule

check this link

Create your own Dynamic Filters 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@ayano 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@ayano 

I believe I also answered your question in my 1st response to use client callable script include.

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@ayano 

Any update to this?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader