
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 09:01 AM
Hi SN Community,
I'm trying to create a script where I can get the first email received in the case
(but specifically the message body)
Through the code below I can only get the internal work notes:
var gr = new GlideRecord('sn_customerservice_case');
gr.get('bbbc8f5c0fd883405f89e0ba42050e47');
gs.info(gr.work_notes.getJournalEntry(-1));
I need to get the text of the first email in the cases in order to start training a
machine learning (classification) model on the platform.
Any idea how I can get this data?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 09:09 AM
You need to refer sys_email table. All the email sent or received are stored in this table. You can put filters to get your desired result and into this table you have a field called body that holds the body of the email received.
Feel free to mark correct and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 09:08 AM
Hi Rafaeloneil,
There is one related email table you get the data first email from table Check it in related list on Case table
Check the below link
https://community.servicenow.com/community?id=community_question&sys_id=ef1a5a3bdbb90d50e515c223059619fa
Thanks
Chandu Telu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 09:09 AM
You need to refer sys_email table. All the email sent or received are stored in this table. You can put filters to get your desired result and into this table you have a field called body that holds the body of the email received.
Feel free to mark correct and helpful.