
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 03:44 AM
We are trying to put a button on ticket form of Service Portal that once clicked will add an additional comment or a work note to the current incident being viewed.
We tried the following code on our if statement when the button is clicked but nothing is being added on the incident:
gr.setValue('work_notes', "The caller did not feel that this issue was resolved.");
gr.setValue('comments', "Please reopen this incident.");
gr.setValue('state', 2);
However the code on line 3 is working just fine (this if statement is inside another if statement which checks if the current table is the incident table).
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 04:01 AM
Hi Jimboy,
You can replace the code with either of the below blocks.
gr.work_notes="The caller did not feel that this issue was resolved.";
gr.comments= "Please reopen this incident.";
gr.setValue('state', 2);
gr['work_notes'].setJournalEntry("The caller did not feel that this issue was resolved.");
gr['comments'].setJournalEntry("Please reopen this incident.");
gr.setValue('state', 2);
Both will work.
Hope this helps.
Regards
Ujjawal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 04:59 AM
Thanks. Though the second option you mentioned can be more short by using what jaspalsinghchot mentioned above:
gr.comments.setJournalEntry('Please reopen this incident.');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2019 03:29 AM
I tried with below piece of code but its still not reflecting in incident..only the sys_journal_field is updated..
var gr=new GlideRecord('incident');
gr.setWorkflow(false);
if(gr.get('05b10fd9db9c3300b75573278c9619b8'))
gr['comments'].setJournalEntry("Please reopen this incident.");
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2019 05:47 PM
setWorkflow(false) prevents journal fields from being updated sadly.