- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2023 09:18 AM
Hi,
I am trying to run a glide record onto the sys_journal_field table to get the last 2 results. I then need to see if they are comments or work notes and post them into the correct field across an API. I have run into some issues with my script, I can get it to log the values but can't seem to get it to return the values.
Here is the script I'm running;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2023 06:59 AM
Having attended a lab at Knowledge I was introduced to ServiceNow Remote Instance spoke - this has an action called Look up Worknotes/comments which does all this work for me and solves my issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2023 09:21 AM
The whole point of my suggestion to use getJournalEntry was to not query the sys_journal_field table. You should just be passing in a GlideRecord of type Task and a string called say journalField. Then pass both of those to the script and just do
output.journalEntry = "";
if(inputs.myTaskGlideRecord.isValidField(inputs.journalField))
output.journalEntry = inputs.myTaskGlideRecord[inputs.journalField].getJournalEntry(1);
You can then call the action when the comments changes to get the last comment and call it for work notes when work notes changes to get the last work note.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2023 06:59 AM
Having attended a lab at Knowledge I was introduced to ServiceNow Remote Instance spoke - this has an action called Look up Worknotes/comments which does all this work for me and solves my issue.