- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2018 03:56 PM
I am fairly new to ServiceNow development. I want to add the project name to the Status report under Related Link on Projects page. See attachment for location of status report and for steps for location of adding field in list.
Page - project_status_report -> Widget - Project Information
<div>
<div class="overview">
<div class="panel panel-{{::c.options.color}} b">
<div class="panel-heading">
<div class="panel-title">{{ADD PROJECT NAME HERE}}${Overview}</div>
</div>
<div class="panel-body">
<table class="info-table">
<tbody class="tbody-class">
<tr>
<td>
<div class="label-column">
<h5>${Portfolio}</h5>
</div>
<div class="value-column bold">
{{data.portfolio_value}}
</div>
</td>
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2018 10:14 PM
Add below code in "Project Information" widgets HTML portion at line number #19
<td>
<div class="label-column">
<h5>${Project}</h5>
</div>
<div class="value-column bold">
{{data.short_description}}
</div>
</td>
Code:
Result:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020 07:29 AM
After LOTS of searching the community with no luck, I found the answer to this in the script include PmProjectStatusReport.
Most of the data is returned by the function headerInfoPlain. To include other out-of-box or custom fields, add it to the returned object:
return {
short_description: projectRec.getValue("short_description"),
number: projectRec.getValue("number"),
project_manager_label: gs.getMessage("Project Manager"),
project_manager_value: projectRec.getDisplayValue("project_manager"),
executive_sponsor_label: gs.getMessage("Executive Sponsor"),
executive_sponsor_value: projectRec.getDisplayValue("u_executive_sponsor"),
...
Then just reference the new value in your HTML template:
<div class="label-column">
<h5>${Executive Sponsor}</h5>
</div>
<div class="value-column bold">
{{data.executive_sponsor_value}}
</div>
The variable projectRec is the project record, and projectStatusRec is the status report record -- good to know so you can reference the correct one to get your new fields.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020 08:16 AM