header-logo.png
header-logo.png

Clarity PPM Technical Tip: Mailing Jasper Report via GEL Script

Automate Mailing Jasper Report to Stakeholders via GEL Script

Problem Scenario:

Project managers and stakeholders identified on the project often expect to receive the status report on a weekly basis or at a set frequency in their mailbox. This is possible by using the jasper report scheduling feature in Clarity where a schedule can be created per project. In the schedule, it is possible to define the recipients and the frequency. The downside of this method is that every time a new project is created, the schedule for the project has to be created manually and every time the stakeholders identified on the project are updated the schedule has to be manually updated. This also ends up creating too many schedules in the advanced reporting making it difficult to maintain over a period of time. The below solution provides an efficient way of automating sending reports to the relevant stakeholders at desired frequencies without the hassle of having to create manual schedules.

Solution:

Invoking the rest apis of jasper reports we can easily automate the process of emailing the required jasper report to the required stakeholders via GEL scripting. This method provides a flexible and customizable way to generate Jaspersoft reports, allowing users to modify the report format, recipients, and schedule to fit their specific needs and requirements.

Code Snippet:

{

“simpleTrigger”:{

“startDate”:”2023-04-01T00:00:00.000+00:00″, “occurrenceCount”:-1, “repeatInterval”:1, “repeatIntervalUnit”:”WEEK”,

“timezone”:”UTC”, “endTime”:”2024-03-31T23:59:59.999+00:00″, “misfireInstruction”:1

},

“reportUnitURI”:”/reports/samples/AllAccounts”, “parameters”: “projectID:500100”, “label”:”My Schedule”,

“description”:”This is my first schedule”, “baseOutputFilename”:”MyReport”, “outputFormats”:[ “PDF” ],

“repositoryDestination”:{

“folderURI”:”/reports/samples”, “sequentialFilenames”:true, “overwriteFiles”:false

},

“simpleTriggerSettings”:{

“timesToSendReport”:1, “minutesToWaitForReport”:0

},

“emailNotificationSettings”:{

“enabled”:true, “subject”:”My Report Schedule”, “messageText”:”Please find the report attached.”,

“toAddresses”:[ “example@email.com” ], “ccAddresses”:[ “example2@email.com” ], “bccAddresses”:[ “example3@email.com”],

“subjectPrefix”:””, “fileAttachmentName”:”MyReport.pdf”, “outputFormat”:”PDF”, “zipAttachments”:false,

“useReportOutputAsAttachment”:true

},

“outputLocale”:”en_US”, “timezone”:”UTC”

}

Author: Arjun K, PPM Consultant
Contact us:
For any questions or inquiries about our PPM service offerings please contact us at info@albatrozsolutions.com