- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 08:16 AM - edited 09-13-2023 08:18 AM
Hi All,
I had a list of assignment group sysid (around 10 assignment groups )in system property and I need to add a query in glide record to check the assignment group is one of those from the property. I am using only script include to do that and the below code is not working.
var prob=new GlideRecord("problem");
var getGrp = gs.getProperty('xyz_Assignmentgroups');
var spl = getGrp.split(',');
for (var i = 0; i < spl. Length; i++)
{
var sgroup=spl[i];
gs.log("xyz sgroup"+sgroup);
prob.addQuery('assignment_group',sgroup);
}
prob.query();
while prob.next()
{
....
}
This is not working ,the add query of assignment group condition is not working. Not sure how to add the query to check the sysid's is one of those assignment group from system property in script include.
Anyone can please help me on this
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 06:41 AM - edited 09-14-2023 06:41 AM
Hi @Sangeetha8,
You can put query like below
var groups = gs.getProperty('test_assignment_group_list');
var grGroup = new GlideRecord('problem');
grGroup.addEncodedQuery("assignment_group.sys_idIN" + groups);
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 07:02 AM - edited 09-14-2023 07:09 AM
Thanks Vishal ,It is working.
Do you know how to do for excluding the assignment group is not one of condition from the system property in simple way without using for loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 07:09 AM
Hi Sangeetha
Unfortunately for excluding we can do it one at a time only.
gr.addEncodedQuery("assignment_group.sys_id!=" + <sys_id>)
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 06:23 AM
I have created system property with multiple sys_id of assignment group values, And call system property using g_scratchpad in display BR.
I need to write on change client script based on the change of Assignment group I need to show in dropdown choices.
if(group a, group b, group c)
able to see certain choices
else if(group b, group d, group e)
certain choices
I'm using conditon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 07:28 AM
If possible can you share some screenshot of your code...??
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 07:59 AM - edited 09-04-2024 08:01 AM
around 70 choices I need to add in loop based on the assignment group I need to visible choices. I have tried with SI also but didn't got result any other way if we have in bulk we can visible choices?