- 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-26-2017 04:07 AM
This is an example of incident record:
You need to update below attributes in above URL:
<INSTANCE_NAME>
<SYS_ID_OF_INCIDENT>
Also, you can try to use "Simple List" widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 08:17 AM
Hi,
Thank you for this hint, it is very helpfull.
Could you please show me how to make the field mandatory?
Thank you
Regards,
Miora
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 08:46 AM
Hi Miora,
Good to know
For making field mandatory, you can use "Catalog UI Policy" if you are using catalog item/record producer else you can "UI Policy" for table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2017 07:13 PM
Hi Chirag,
Thanks, this is really useful
Is there a way to put the closure notes in the conversation history widget as well?
Cheers,
Anna