Incident Activities showing as Guest user

Bharat Shinde
Tera Contributor

Hi,


I have Scripted REST API & Scripted REST Resource used as listener for Slack events subscription.
When ever someone's replies in slack thread I am reading the reply text and updating Incident record for work_notes field.

gr.work_notes = "Slack Thread Reply: " + replyText;
gr.update();

In Incident Activities, it is showing that text as Guest, which I would like to see as actual slack user name.
Not sure which property I should update along with work_note.

I tried with below code but still it shows as guest in activities section, though it shows Incident is update by mentioned user name.
gr.sys_updated_by = "FirstName.LastName";
gr.autoSysFields(false);

 

BharatShinde_0-1698232405779.png

 


I would like to see same user in Activities section as well.

Any thoughts?

 

Regards,
Bharat.

3 REPLIES 3

Saurav11
Kilo Patron

Hello,

 

The scripted rest API is being triggered via some integration user right. Does the user is present in ServiceNow? 

Hi Saurav,

This scripted REST API is a web service that allowing external systems to talk to ServiceNow.

I did not get what you mean by triggered via some integration user. It is a listener and getting called by slack.

I do have all slack users in SN. Even if I hardcode any user, it still not work.

 

Regards,

Bharat

Bharat Shinde
Tera Contributor

I found way to set user with below code:

gr['work_notes'].setJournalEntry(replyText,"User.Name");