Project Workspace status report - add custom field to the "Status History" dynamic content

Attila Beregvar
Tera Guru

Hello Community,

 

On the new project workspace, Status Reports are built on doc templates, utilizing dynamic contents. I would like to add a custom field to the Status History block of the status report, but only the ootb fields are showing up while inserting the dynamic content:

AttilaBeregvar_0-1748434381222.png

Custom fields are generally available at other parts of the report, I can select them as a dynamic content, but not available in the Status History block - I assume there is a script/API that builds this Status History block somewhere in the background, but I couldn't find anything related yet.

Does anyone have an idea how to make other fields available in the Status History?

Thanks!

1 ACCEPTED SOLUTION

Govardhan7
ServiceNow Employee
ServiceNow Employee

StatusReportDynamicTemplateDataProviderSNC is a read-only Script Include designed to prevent direct customization. To support extensibility, we’ve provided an extension Script Include named StatusReportDynamicTemplateDataProvider, which allows you to override functions from the SNC version.

You can override the fetchStatusDataRecords function in the extension script to incorporate your custom logic.

View solution in original post

4 REPLIES 4

Govardhan7
ServiceNow Employee
ServiceNow Employee

Hi @Attila Beregvar 

The Status History block of fields is constructed within the ProjectWorkspaceStatusReportUtil Script Include. You can find this logic in the createTableFields function, specifically if your Project Workspace version is 6.2.1 or below.

Hello @Govardhan7 ,

Thanks for your input! I've checked, and indeed the ProjectWorkspaceStatusReportUtil script include is responsible to build up the selectable fields in the Status History block, but I think the value behind those blocks is handled in another script: "StatusReportDynamicTemplateDataProviderSNC" with the function "fetchStatusDataRecords".
Unfortunately this script include is protected/read-only, so even admins cannot modify it.

Do you have any experience with this?

Govardhan7
ServiceNow Employee
ServiceNow Employee

StatusReportDynamicTemplateDataProviderSNC is a read-only Script Include designed to prevent direct customization. To support extensibility, we’ve provided an extension Script Include named StatusReportDynamicTemplateDataProvider, which allows you to override functions from the SNC version.

You can override the fetchStatusDataRecords function in the extension script to incorporate your custom logic.

SravyaPangu
Tera Contributor

Hello @Attila Beregvar@Govardhan7  I have similar requirement and I did override the fetchStatusDataRecordsfunction in the extension script to incorporate my custom logic. Still I am unable to access those field in the document templates. Below is the script screenshot. 
I appreciate your help. Thank you in advance.  

SravyaPangu_0-1752073639694.png