- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 08:01 AM
I am trying to create an entity filter for the Department table based on field values on that department's related CI records. (For example, departments with operational CIs.) Because this can't be done using the filter conditions UI we have created a script to do it.
The problem is that while the entity filter says it is getting the correct number of records it never actually populates the parent entity type.
A related oddity is that if I manually add the SysIDs in the same format that the script returns, then the "SysID is" filter condition returns zero records. If I use the "SysID is one of" condition the opposite is true. The manually created list returns the expected number of records and populates the entity type. If I use the script with this condition it returns zero records. Thus, the script generated list and a the same list that has been entered manually behave differently.
So... How do I achieve the goal of returning department entities based on a subset of their CIs? Is there something broken about the way script generated record lists populate entity types or am I just doing something wrong?
The only thing I can think of to fix this is to create a new table and use the script to populate it with the departments. The entity filter would then use that table to populate the entity type.
Solved! Go to Solution.
- Labels:
-
Policy and Compliance Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 08:33 AM
I solve the problem! In the entity filter where I call the script I forgot to add the scope at the beginning of the script name.
I.e. I called it as 'departmentswithredandpurpledata'
I should have called it as 'sn_grc.departmentswithredandpurpledata'
Now it both correctly shows the records found and adds them to the entity type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 08:39 AM
Hello,
never actually populates the parent entity type - can you share your script? If you're pulling back the value count correctly then the issue is what you're trying to return to your entity type - this is further validated because you can manually define the SysIDs to get the entity populated.
Please mark my answer as correct/helpful if it has helped you.
Thanks,
Logan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:13 AM
Hello,
You're passing back an array of sys_id's - therefore shouldn't your Sys ID condition be is one of?
Please mark my answer as correct/helpful if it has helped you.
Thanks,
Logan
--
LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 01:44 PM
We tried that also - no luck. We have even copied the SysIDs directly from the printed output of the script when run as a background script and it worked. It is only when the javascript reference is in the filter condition that it fails. It fails even though the entity filter claims to have found records.