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

Hi,

then update the sys_updated_by field for sys_journal_field record for that comment value

Regards
Ankur

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

I tried,

If I tried to update the sys_created_by it always go back to my user.

And we do not have a sys_updated_by field on this table.

Hi,

share your script where you are updating the sys_creaated_by of sys_journal_field table record

it should work

ensure you use this during update to forcefully update the field

obj.autoSysFields(false)

Regards
Ankur

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

Margeaux Fixsen
Kilo Explorer

The Information you shared above is great. I have been reading all you shared here. In this you explained everything very well. If i want any further guideline we will contact you here see https://community.servicenow.com/community?id=community-results-question&sys_id=7ddb940f1bcb89d0587a11751a4bcbab

Thanks

Margeaux Fixsen
Kilo Explorer

The Information you shared above is great. I have been reading all you shared here. In this you explained everything very well. If i want any further guideline we will contact you here see https://community.servicenow.com/community?id=results=community_question&sys_id=7ddb940f1bcb89d0587a11751a4bcbab

Thanks