Able to fetch required result in background script but the same logic is unable to give expected results when ran on Business rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 05:43 AM
Able to fetch required result in background script but the same logic is unable to give expected results when ran on Business rules.
This the logic we tried in background script,working as expected it printed 6 times:
The same logic when tried on Business rule doesn't even print once:
Any help is appreciated!
Thanks.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 06:01 AM
Hi,
With putting log to print num3 ,even with current.sys_id or surrent.getUniqueValue() its printing the sys_id of the result record only.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 06:59 AM
Is it a before BR or After BR?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 08:53 AM
It will not work if it is a before business rule.
It should be After business rule.
And also can you check after the scan record is generated and the result sysid is printed in log,
Manually can you go to scan_suite_execution table and apply filter as result is the sysid and see if it is returning records or not.
Regards,
Sumanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 08:01 AM
Hi Aindrila,
It seems the business rule is running on scan_result table. Is this the same table to which sys id record you used in background script?
Please mark this answer as correct/helpful if it has added value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 08:27 AM
yeah yes.the sys_id is used is the sys_id of the rseult record of the scan_result table.And the scan_suite_execution table returns the same sys_id,the id of the referenced result record.