- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 08:12 PM
What seems to be the reason why script is working in background script but not working in Business Rule?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 09:28 PM
how many records you want to insert sn_grc_issue? 1 or some other value?
try this
(function executeRule(current, previous /*null when async*/ ) {
var entity = new GlideRecord('sn_grc_profile');
entity.query();
while (entity.next()) {
var issue = new GlideRecord('sn_grc_issue');
issue.initialize();
issue.classification = 3;
issue.short_description = entity.name + ' has a control test failure';
issue.insert();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 09:28 PM
how many records you want to insert sn_grc_issue? 1 or some other value?
try this
(function executeRule(current, previous /*null when async*/ ) {
var entity = new GlideRecord('sn_grc_profile');
entity.query();
while (entity.next()) {
var issue = new GlideRecord('sn_grc_issue');
issue.initialize();
issue.classification = 3;
issue.short_description = entity.name + ' has a control test failure';
issue.insert();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 10:40 PM
Hi @Ankur Bawiskar
Actually the requirement here is that when a control test issue is closed and the Control effectiveness is Ineffective it will create an Issue.
And when the issue is created, the Classification should be auto-populated to 'Audit' which is the value is 3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 11:02 PM
I hope your BR is having proper conditions i.e State is Closed AND Control Effectiveness is Ineffective
you are querying entire sn_grc_profile table without any filter but why?
which GRC Profile you want to pick? add that query
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 11:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 11:17 PM
so BR is on sn_audit_control_test and based on BR condition you want to create issue for the sn_audit_engagement
I am not very sure on the table hierarchy for GRC, but what I could say is your requirement is simple to achieve using script
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader