- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2016 07:59 AM
Hi Everyone,
Got a quick question for you.
We have an integration with another instance of servicenow on the requested item table. Now we want to copy over several fields over to the other instance using a soap integration.
We also want to copy over the work_notes of the table to the other instance. However due to performance reasons we want to use the After Business Rule. Now the problem will start to show: "in a After Business Rule how do we access the work_notes?"
Thnx for any help.
Regards,
Luc
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2016 08:02 AM
you have to use getJournalEntry()
current.work_notes.getJournalEntry(1); //will get the last entrie.
current.work_notes.getJournalEntry(-1) //will get all entries
http://wiki.servicenow.com/index.php?title=GlideElement#getJournalEntry.28int.29
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2016 08:02 AM
you have to use getJournalEntry()
current.work_notes.getJournalEntry(1); //will get the last entrie.
current.work_notes.getJournalEntry(-1) //will get all entries
http://wiki.servicenow.com/index.php?title=GlideElement#getJournalEntry.28int.29

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2016 08:02 AM
Hello Luc,
Please refer below script and adjust it as per your req.
var notes = current.work_notes.getJournalEntry(-1); //gets all journal entries as a string where each entry is delimited by '\n\n'
var na = notes.split("\n\n"); //stores each entry into an array of strings
for (var i = 0; i < na.length; i++)
gs.print(na[i]);
http://wiki.servicenow.com/?title=Using_Journal_Fields#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2016 08:05 AM
For the full list of methods, you can refer https://developer.servicenow.com/app.do#!/api_doc?v=helsinki&type=server&scoped=false&to=method_clas...