Function setJournalEntry is not allowed in scope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2015 04:27 PM
Hi. We allow certain device management functions from within incident. Part of the logic is to add entries to incident's journal the tell a person of success or failure of a particular action. But it seems there is another restriction: Function setJournalEntry is not allowed in scope
Is there an alternative?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2015 08:38 PM
The setValue() method is not supported for Journal fields. Instead, assign values in script. Please take the look at the below example for reference.
function onAfter(current, previous) {
//This function will be automatically called when this rule is processed.
var gr = new GlideRecord('incident');
gr.addQuery('sys_id','d71b3b41c0a8016700a8ef040791e72a');//Harcoded sysid just for testing
gr.query();
while(gr.next())
{
gr.comments = 'Pradeep Sharma added comments to this ticket';
gr.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2015 08:58 PM
Thank you! Worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2015 07:15 PM
What about getJournalEntry? This is also apparently disallowed in scoped API. How can I read the current journal values? Thanks,
Noah