How to add Close Notes in Service Portal (Requests)

Milan13
Giga Expert

Hello,

I need to add "Close Notes" section (preferrably under the Location or Attachments section as per screen shot below..) for closed incidents to the service portal view (Requests)

Not sure what is the easy way to do this..

Any idea how to do this?

Many thanks,

Milan

find_real_file.png

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi if you need a separate section. You can build your own widget

Sample:

HTML:

<div class="panel panel-default">
<div class="panel-heading bundle-title">
<h2 class="h6 panel-title bundle-title-content">Close COD </h2>
</div>
Close CODE: {{::data.notes}}

</div>

 

Server script:

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */

var gr = $sp.getRecord();
data.tableLabel = gr.getLabel();
data.notes = gr.getValue("close_code");
console.log("portal notes"+data.notes);

})();

And add this widget by going to page designer of ticket portal

find_real_file.png

Regards
Harish

View solution in original post

4 REPLIES 4

AbhishekGardade
Giga Sage

Hello Milan,

Please go through this link that may help.

https://docs.servicenow.com/bundle/istanbul-servicenow-platform/page/build/service-portal/task/t_Con...

You need to edit the Page: Ticket Form

1.Go to Service portal -> Pages-> open ID: ticket

Thanks,

Abhishek

 

Thank you,
Abhishek Gardade

Kristoffer Mon1
Giga Expert

If you have a pretty good grasp on creating widgets take a look at the "Ticket Fields" widget. Notice in server side code how it's pulling the fields that are displayed in the widget?

find_real_file.png

One option is to clone the "Ticket Fields" widget, modify the server side code to include close_notes then added the customized widget to that page via the Page Designer.

To add it between Location and Attachments, add another version of a cloned Ticket Field widget in between those sections via the page desiginer. This version would then only display the close_notes field.

Harish KM
Kilo Patron
Kilo Patron

Hi if you need a separate section. You can build your own widget

Sample:

HTML:

<div class="panel panel-default">
<div class="panel-heading bundle-title">
<h2 class="h6 panel-title bundle-title-content">Close COD </h2>
</div>
Close CODE: {{::data.notes}}

</div>

 

Server script:

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */

var gr = $sp.getRecord();
data.tableLabel = gr.getLabel();
data.notes = gr.getValue("close_code");
console.log("portal notes"+data.notes);

})();

And add this widget by going to page designer of ticket portal

find_real_file.png

Regards
Harish

This worked for me - if you want to add closure notes as well as the code I did the following:

HTML:

<!-- Created by JG, 30/09/2020 -->
<div class="panel panel-default">
<div class="panel-heading bundle-title">
<h2 class="h6 panel-title bundle-title-content">Resolution Details</h2>
</div>
<p>
   &emsp;Resolution code: {{::data.notes}}
</p>
<p>
   &emsp;Resolution notes: {{::data.closurenotes}}
</p>
</div>

 

Server:

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */

var gr = $sp.getRecord();
data.tableLabel = gr.getLabel();
data.notes = gr.getValue("close_code");
data.closurenotes = gr.getValue('close_notes');
console.log("portal notes"+data.notes);

})();