How do you retrieve User objects from "sys_updated_by" on Task/Incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 03:17 PM
I have not developed in ServiceNow for over a year now. I recently downloaded a Personal Developer Instance to play around with and refresh myself. I quickly ran into a few walls that I can't find answers for. Hoping the community could help.
I am trying to retrieve user data from Incident.sys_updated_by field.
The Updated By (sys_updated_by) field on Incident/Task is a String type field. Working on several client instances in the past, I was pretty sure they had a User reference field for Updated By. I have never worked implementation side of ServiceNow. Is there a safe/best-practice method for updating this field? Or is the only solution to create a new field as a user reference and business rule/default value to set field on Insert/Update?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2020 02:51 PM
Hi,
You wouldn't change this field type unless you wanted to go down the route of "You change it, you own it" and fall out of support. You can indeed add a secondary reference field to allow access to the user object going forward.
My question, what is your use case for accessing the user object? What issue or objective are you trying to solve as there may be better solutions.
Example - I've had a request for this in the past as the user wanted to be able to report on incidents updated by a user with a certain job title. After explaining that the report would be a snapshot of when they run it as the field value is transient, the aim could better be accomplished by using a metric definition to record all users updated. and then report on that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2020 02:54 PM
"sys_updated_by" is a sys_id to a record in "sys_user" table. That is, it's a reference field in a form to the sys_user table.
ServiceNow updates this field based on who updated the incident record. This field can be used for auditing purposes. What would be the use case to update this field from an your application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 09:41 AM
sys_updated_by is a string field