Get array from script include through query business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 01:02 AM
From a query business rule, we are calling a script include and returning a array of sysids through a function. I am unable to get that array in query business rule. Anyone please help me here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 01:08 AM
@Nagasri Could you describe the issue you are facing with the example script. Are you getting an undefined value from the Script include? or are you getting a single sys id repeated across all the indexes in the array?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 01:24 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 02:20 AM
@Nagasri Could you update you code as follows.
var stringArray = JSON.stringify(caseSysIds);
gs.addInfoMessage(stringArray);
return stringArray;
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 02:28 AM
Hi @Nagasri ,
Did you check if you are getting the logs mentioned in the script?
Is your code going inside the if statement itself?
I suspect the way you are comparing array could be failing.
Aman Kumar