How to add a new field into the project - status report?

Community Alums
Not applicable

I added a new field "Executive Sponsor" in the pm_project table and trying to pull that value into the Status Report. Added the new field into this widget too, but I don't see the value here.. Can anyone tell how to pull the value into Status Report?

find_real_file.png

1 ACCEPTED SOLUTION

Alok Kumar2
Tera Expert

Hi Rajinis,

There are two things that you need to do.

In the Project Information widget, a script include is getting called - PmProjectStatusReport. So you need to update the script include first.

 headerInfoPlain: function(sysId, weekDate, reportId) {
        //gs.info("Into headerInfo: " + sysId);
		var projectStatusRec;
		if(reportId)
			projectStatusRec = this.getProjectStatusBySysId(reportId);
		else if(weekDate)
			projectStatusRec = this.getProjectStatus(sysId, weekDate);
		else {
			projectStatusRec = this.getProjectStatusByProjectID(sysId);
			if(projectStatusRec.hasNext())
				projectStatusRec.next();
		}
        var projectRec = this.projectRecord(sysId);
        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"),
            portfolio_label: gs.getMessage("Portfolio"),
            portfolio_value: projectRec.getDisplayValue("primary_portfolio"),   
            start_date_label: gs.getMessage("Planned Start Date"),
            start_date_value: projectStatusRec.getDisplayValue("start_date"),
            work_start_label: gs.getMessage("Actual Start Date"),
            work_start_value: projectStatusRec.getDisplayValue("work_start"),
            work_end_exists: JSUtil.notNil(projectRec.getValue("work_end")),
            work_end_label: gs.getMessage("Actual End Date"),
            work_end_value: projectStatusRec.getDisplayValue("work_end"),
            end_date_label: gs.getMessage("Planned End Date"),
            end_date_value: projectStatusRec.getDisplayValue("end_date"),
            percent_complete_label: gs.getMessage("% Complete"),
            percent_complete_value: projectStatusRec.getDisplayValue("percent_complete"),
            state_label: gs.getMessage("State"),
            state_value: projectStatusRec.getDisplayValue("state"),
			planned_cost: projectStatusRec.planned_cost.getCurrencyDisplayValue(),
			work_cost: projectStatusRec.work_cost.getCurrencyDisplayValue(),
            description_value: projectRec.getDisplayValue("description"),
			
	    project_phase: projectRec.getDisplayValue('u_project_phase')// add your field here
			
        };
    },

Then in the html of the widget, add the below lines with the field names of your variables(for me it was project phase).Make sure you add it in the right place.

  <td>
    <div class="label-column">
     <h5>${Project Phase}</h5>
    </div>
    <div class="value-column bold">
      {{data.project_phase}}
    </div>
   </td>
    

 

Thanks!

Note:Please mark it as correct or helpful if it helps!!

View solution in original post

4 REPLIES 4

sachin_namjoshi
Kilo Patron
Kilo Patron

You will have to modify service portal widget to add new field value for project status report.

 

find_real_file.png

 

Regards,

Sachin

Alok Kumar2
Tera Expert

Hi Rajinis,

There are two things that you need to do.

In the Project Information widget, a script include is getting called - PmProjectStatusReport. So you need to update the script include first.

 headerInfoPlain: function(sysId, weekDate, reportId) {
        //gs.info("Into headerInfo: " + sysId);
		var projectStatusRec;
		if(reportId)
			projectStatusRec = this.getProjectStatusBySysId(reportId);
		else if(weekDate)
			projectStatusRec = this.getProjectStatus(sysId, weekDate);
		else {
			projectStatusRec = this.getProjectStatusByProjectID(sysId);
			if(projectStatusRec.hasNext())
				projectStatusRec.next();
		}
        var projectRec = this.projectRecord(sysId);
        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"),
            portfolio_label: gs.getMessage("Portfolio"),
            portfolio_value: projectRec.getDisplayValue("primary_portfolio"),   
            start_date_label: gs.getMessage("Planned Start Date"),
            start_date_value: projectStatusRec.getDisplayValue("start_date"),
            work_start_label: gs.getMessage("Actual Start Date"),
            work_start_value: projectStatusRec.getDisplayValue("work_start"),
            work_end_exists: JSUtil.notNil(projectRec.getValue("work_end")),
            work_end_label: gs.getMessage("Actual End Date"),
            work_end_value: projectStatusRec.getDisplayValue("work_end"),
            end_date_label: gs.getMessage("Planned End Date"),
            end_date_value: projectStatusRec.getDisplayValue("end_date"),
            percent_complete_label: gs.getMessage("% Complete"),
            percent_complete_value: projectStatusRec.getDisplayValue("percent_complete"),
            state_label: gs.getMessage("State"),
            state_value: projectStatusRec.getDisplayValue("state"),
			planned_cost: projectStatusRec.planned_cost.getCurrencyDisplayValue(),
			work_cost: projectStatusRec.work_cost.getCurrencyDisplayValue(),
            description_value: projectRec.getDisplayValue("description"),
			
	    project_phase: projectRec.getDisplayValue('u_project_phase')// add your field here
			
        };
    },

Then in the html of the widget, add the below lines with the field names of your variables(for me it was project phase).Make sure you add it in the right place.

  <td>
    <div class="label-column">
     <h5>${Project Phase}</h5>
    </div>
    <div class="value-column bold">
      {{data.project_phase}}
    </div>
   </td>
    

 

Thanks!

Note:Please mark it as correct or helpful if it helps!!

Community Alums
Not applicable

Thank you Alok. This worked.

Can you share your html code for the project phase field?