Don't Update "sys_updated_on" when bulk updating via REST API (PUT)

Jamison Cote2
Mega Expert

Hey everyone,

I would like to update a few thousand records via REST API (PUT), but I don't want the 'sys_updated_on' field to be updated. I want this field value to stay the same, and be ignored.

How can I accomplish this via REST API?

I know that I can do the following via a GlideRecord internally with:

gr.setWorkflow(false);
gr.autoSysFields(false);

But I'm uncertain as to how to best attain this via API.

I'm sure there's an answer out there.

Thanks. 

1 ACCEPTED SOLUTION

As of now, there is no REST API sysparam to NOT update system fields.

 

https://developer.servicenow.com/app.do#!/rest_api_doc?v=madrid&id=r_TableAPI-GET

 

You will have create business rule to NOT update system fields for REST API transactions.

 

Regards,

Sachin

View solution in original post

4 REPLIES 4

sachin_namjoshi
Kilo Patron
Kilo Patron

You can write business rule on your taget table to include below method.

 

current.autoSysFields(false);

I assume that you are authenticating with particular using while consuming REST API.
You can add this user condition in business rule to not update system fields.

Regards,
Sachin

Jamison Cote2
Mega Expert

Hi Sachin,

 

I was thinking of performing this via Business Rule, but was particularly wondering if there was a way to format the REST API parameters to not update the 'sys_updated_on' field.

Again, it may not be possible via REST

As of now, there is no REST API sysparam to NOT update system fields.

 

https://developer.servicenow.com/app.do#!/rest_api_doc?v=madrid&id=r_TableAPI-GET

 

You will have create business rule to NOT update system fields for REST API transactions.

 

Regards,

Sachin

Thanks - will mark this as correct unless someone else can come along and figure out a way to do it purely by the REST call.