
- 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 03:47 AM
Hi Jimboy,
Try using below code,
gr.comments.setJournalEntry('Please reopen this incident.');
Thanks,
Jaspal Singh
Hit Like or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2020 01:16 PM
Its works \o/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 03:56 AM
Set Value won't work in this case.
You can use:
gr.comments = "Please reopen this incident.";

- 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