- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 09:02 PM
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:
Here is the flow:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 10:16 PM
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.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 10:16 PM
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.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 07:18 PM
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:
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:
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 07:56 PM
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