Flow Designer: Update Additional comments via email as the sender

dmorgan_isc
Tera Expert

Hi,

i have build a flow that will add additional comments to an incident, based on the latest text of an email. However it is adding the comments as the "System" user. Is there a way to make this update as the sender of the email.

EG:

dmorgan_isc_0-1700802054905.png


Here is the flow:

dmorgan_isc_1-1700802116549.png

 

1 ACCEPTED SOLUTION

Tai Vu
Kilo Patron
Kilo Patron

Hi @dmorgan_isc 

Let's use the API below to adds a journal entry and author as a work note or comment field.

setJournalEntry(String entry, String userName)

 

Sample

var now_GR = new GlideRecord("incident");
now_GR.addQuery("sys_id", "<sys_id_value>");
now_GR.query();
if(now_GR.next()){
  now_GR.comments.setJournalEntry("Content of the journal entry.", "<your_user_id>");  
  now_GR.update();
}

 

If your flow is specific to trigger updating additional comments, you can try the option User who initiates session inside Flow properties.

TaiVu_0-1700806575741.png

 

Cheers,

Tai Vu

 

View solution in original post

3 REPLIES 3

Tai Vu
Kilo Patron
Kilo Patron

Hi @dmorgan_isc 

Let's use the API below to adds a journal entry and author as a work note or comment field.

setJournalEntry(String entry, String userName)

 

Sample

var now_GR = new GlideRecord("incident");
now_GR.addQuery("sys_id", "<sys_id_value>");
now_GR.query();
if(now_GR.next()){
  now_GR.comments.setJournalEntry("Content of the journal entry.", "<your_user_id>");  
  now_GR.update();
}

 

If your flow is specific to trigger updating additional comments, you can try the option User who initiates session inside Flow properties.

TaiVu_0-1700806575741.png

 

Cheers,

Tai Vu

 

Thanks for the tip. I do remember this option when i created the flow and think i set it to system user. I tried to change in properties and i do not have the option to change this:

dmorgan_isc_0-1701054927516.png



I found: https://developer.servicenow.com/dev.do#!/learn/learning-plans/utah/servicenow_administrator/app_sto... states:
 NOTE: Flows with an Inbound Email trigger always run as the user who sent the email or the Guest user. The Run As value cannot be set for flows with an Inbound Email trigger.

When i test this however it still runs as system user:

dmorgan_isc_1-1701055038844.png

 

Any ideas?

I re-created the whole flow and selected run as user who initiates session at the beginning of the flow creation and it works now. Thanks for pointing me in the right direction