Is it possible to change the user that comments on a ticket when doing a GlideRecord update?

lee9
Kilo Contributor

When ServiceNow receives a REST message to update a comment on a ticket, it adds the comment as the "Guest" account. Instead, I would like to add the comment to the ticket as the user who sent the REST message to ServiceNow. Is there a way to tell GlideRecord to update as another user. For example, is there a way to update a record via script just like you can while you are impersonating another user? It would be nice to have the activity log on the ticket show the correct user that left the comment.

Thank you.

 

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

what type of API 3rd party is consuming?

Usually the API user which is used for authentication the same user is mentioned in the updated by field

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

The Api user its a generic user for all the users- "API_user_portal",

on the REST they will send me the user name that I will need to enter for the comment user.

Hi,

if they are using user with user_name - API_user_portal

then the same user should be present in the sys_updated_by or sys_created_by of that record.

can you share what you are receiving from them and in which format?

what script have you written?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hey, Yes, I understand.

I do not want to display theAPI_user_portal inside the ticket, instead I want to display the string they send me. (full name of the client)