- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017 10:38 AM
Hi
I need to populate the closed notes field for closed incident in service portal.Could some one please help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017 11:35 PM
Hello,
Form layout or view won't help here because in SP, "Ticket Fields" widget can only show 'number,state,priority,sys_created_on' fields but if you want close notes field then you need to clone the widget and have to add code for close note.
I hope you are looking for below output :
If yes, you can follow below steps :
1. From left navigation. Select "Service Portal Configuration âžš"
2. New tab should open and then select "Widget Editor"
3. Select "Ticket Fields" in Edit an existing widget list.
4. Select "Clone "Ticket Fields" option.
5. Provide name/id for your new custom widget.
6. You need to make changes in "HTML Template" and in "Server Script" (script changes are selected as below):
here is the script which you can copy:
HTML Template:
<div ng-if="data.close_notes != '' " ng-init="variable_toggle=true">
<h4 ng-click="variable_toggle = !variable_toggle" style="cursor: pointer;">
<span style="font-size: 12px;" class="glyphicon"
ng-class="{'glyphicon-chevron-down': !variable_toggle, 'glyphicon-chevron-up': variable_toggle}"></span>
${Close Notes}
</h4>
<div ng-if="variable_toggle">
<hr>
<div class="m-b break-word">
<div>{{data.close_notes}}</div>
</div>
</div>
</div>
Server Side Script:
data.close_notes = '';
data.close_notes = $sp.getFields(gr, 'close_notes');
if(data.close_notes != '') {
data.close_notes = data.close_notes[0].display_value;
}
7. You can replace OOB "Ticket Fields" widget from ticket page with your custom widget.
7.1 - Goto "Service Portal Configuration" from left navigation and select "Page Editor".
7.2 - Select "Ticket" page from the search list.
7.3 - Select "Instance 2" and update Ticket Fields widget with new widget :
8. Now all required changes are complete.
Note: ticket page can be use for other tables like problem so close note will also get visible for problem tickets also if you don't want you can add condition in the server script.
if data.close_notes is empty then "Close Note" will not be visible.
Please let me know if you find any difficulties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017 11:35 PM
Hello,
Form layout or view won't help here because in SP, "Ticket Fields" widget can only show 'number,state,priority,sys_created_on' fields but if you want close notes field then you need to clone the widget and have to add code for close note.
I hope you are looking for below output :
If yes, you can follow below steps :
1. From left navigation. Select "Service Portal Configuration âžš"
2. New tab should open and then select "Widget Editor"
3. Select "Ticket Fields" in Edit an existing widget list.
4. Select "Clone "Ticket Fields" option.
5. Provide name/id for your new custom widget.
6. You need to make changes in "HTML Template" and in "Server Script" (script changes are selected as below):
here is the script which you can copy:
HTML Template:
<div ng-if="data.close_notes != '' " ng-init="variable_toggle=true">
<h4 ng-click="variable_toggle = !variable_toggle" style="cursor: pointer;">
<span style="font-size: 12px;" class="glyphicon"
ng-class="{'glyphicon-chevron-down': !variable_toggle, 'glyphicon-chevron-up': variable_toggle}"></span>
${Close Notes}
</h4>
<div ng-if="variable_toggle">
<hr>
<div class="m-b break-word">
<div>{{data.close_notes}}</div>
</div>
</div>
</div>
Server Side Script:
data.close_notes = '';
data.close_notes = $sp.getFields(gr, 'close_notes');
if(data.close_notes != '') {
data.close_notes = data.close_notes[0].display_value;
}
7. You can replace OOB "Ticket Fields" widget from ticket page with your custom widget.
7.1 - Goto "Service Portal Configuration" from left navigation and select "Page Editor".
7.2 - Select "Ticket" page from the search list.
7.3 - Select "Instance 2" and update Ticket Fields widget with new widget :
8. Now all required changes are complete.
Note: ticket page can be use for other tables like problem so close note will also get visible for problem tickets also if you don't want you can add condition in the server script.
if data.close_notes is empty then "Close Note" will not be visible.
Please let me know if you find any difficulties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 02:56 AM
Thanks chirag.bagdai it really help me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2017 03:04 AM
Hi,
Any idea how to make these fields editable and update the record?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2017 03:10 AM
There is no features of editing fields on "ticket" page, if you want you need to create your own copy.
Else the best way is to redirect your users to "form" page where they can modify other fields also. You may find more details in below thread.
https://community.servicenow.com/thread/264726

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2017 03:26 AM
Could you plz let me know the steps to be followed for the link you had mentioned?
Harish