Adding project name field on project status report

wendyo
Kilo Contributor

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>

1 ACCEPTED SOLUTION

Raju Koyagura
Tera Guru

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:

 

find_real_file.png

 

Result:

find_real_file.png

 

View solution in original post

6 REPLIES 6

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.

 

 

 

Namita Mishra
ServiceNow Employee
ServiceNow Employee

Hi @wendyo ,

Project Name is available on project status report out of the box starting New York release.

find_real_file.png

Thanks,

Namita Mishra