Update assigned to field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 02:13 AM - edited 09-03-2024 02:27 AM
Hi,
Control owner field is on Control(sn_compliance_control) table. Assigned To and Evidence Execution fields on Control Executor(sn_audit_control_compliance) table. If we select control owner, assigned to have update, Only for Evidence Execution field is Manual. Wrote a script but it is not updating the assigned to field. Any help!
Table : control[sn_compliance_control]
After(Insert,Update) business rule
Condition : Control owner changes
Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 03:02 AM
like below
gs.log('start of script');
var controlGR = new GlideRecord('sn_audit_control_execution');
controlGR.addQuery('u_evidence_execution', 'Manual');
controlGR.query();
if (controlGR.next()) {
gs.log('this was executed');
controlGR.assigned_to = current.u_control_owner;
controlGR.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 03:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 03:36 AM
Run this
var controlGR = new GlideRecord('sn_audit_control_execution');
controlGR.addQuery('u_evidence_execution', 'Manual');
controlGR.query();
if (controlGR.next()) {
gs.info('this was executed');
//controlGR.assigned_to = current.u_control_executor;
controlGR.assigned_to = current.getValue('u_control_executor');
gs.info('assigned to updated:'+ controlGR.assigned_to);
controlGR.update();
}
in the log search by message contains 'this was executed'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 03:39 AM
getting below. when i execute above code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 03:40 AM
🙂 you are not doing what i suggested
anyway, is the field updated? Check the record history
is this BR before or after?