Update comments in incident by using background script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 04:58 AM
Hi,
I wrote a background script to update the comments in incident table But didn't update the comments. Please help
Script:
var gr = new GlideRecord('incident');
gr.get('88041f451b080d1039068550604bcb2d');
gr.comments = 'As requested, closed the incident record';
//gr.autoSysFields(false);
//gr.setWorkflow(false);
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 06:05 AM
I don't know that you can run a Background or Fix Script as another user, but you can create a new Scheduled Job to execute a script and try the same script. You can configure this to run once. If your form doesn't already show it, configure it to add the Run as field
then run the script as an administrator. If you have an ACL or Data Policy that even prohibits administrators from updating comments in this situation, there's not much you'll be able to do without disabling that.