Update comments in incident by using background script

Shaik22
Tera Expert

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();

5 REPLIES 5

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

BradBowman_0-1724936603189.png

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.