header-logo.png
header-logo.png

Clarity PPM Technical Tip: Automate Publishing of Status Reports

Automate Publishing of Status Reports via REST

Problem Scenario:

Project managers are expected to create project status reports and publish them periodically on projects to make sure the project team and the stakeholders have visibility on the project’s health. With the recent versions of Clarity PPM, it has got easy to create and build on status reports throughout the week and publish the report by click of a button at the end of the week once the report is final. But often times project managers tend to forget to publish the report which results in the status report being in the draft state at the end of report week and the new status updates are overwritten for the next week. This results in a loss of status updates for the previous week.

Solution:

Invoking the private rest apis of status reports in Clarity we can easily automate the process of publishing the status reports at the end of the reporting week (weekly or bi-weekly or as per desired frequency) via GEL scripting. This method considerably reduces the manual overhead on the Project Managers and prevents accidental data loss.

Code Snippet:

Step 1: Preview Action on Status Report

Endpoint URL: <Clarity_restURL>/private/export

“POST” call –

{

“fileName”:”<status_report_name>”, “fileType”:”PDF”, “heightSelector”:”.gridster-layout”,

“urlSubPath”:”/project/<project_internal_id>/status/<status_report_internal_id>”,

“viewportOrientation”:”portrait”, “viewportSize”:”letter”, “waitSelector”:”.gridster-layout,.canvas-elements-data-ready”,

“widthSelector”:”.canvas-container”

}

This call creates a filename, download PDF URL, and an internal file ID for PDF export – preparing for PDF publish & export.

Step 2: Update Report Status

Endpoint URL: <Clarity_restURL>/projects/<project_internal_id>/projectStatusReports/<status_report_internal_id>

“PATCH” call –

{“reportStatus”: “FINAL”}

This call updates the status report status from “draft” to “final”.

Step 3: Publish Status Report

Endpoint URL: <Clarity_restURL>/private/statusReportPublisher

“POST” call –

{

“statusReportId”: <status_report_internal_id>,

“fileId”: “<pass the fileId from the export rest api call response> ”

}

This call publishes the report and creates the PDF for “final” status report.

Author: Akshaya S, PPM Consultant
Contact us:
For any questions or inquiries about our PPM service offerings please contact us at sales@albatrozsolutions.com