achinnappan Posted August 24, 2021 Share Posted August 24, 2021 Hey guys, Im kind of new to this Jasper Soft products, So I'm using Jasper Server and I have few reports published onto that, So I was trying to configure a scheduled job to send me Reports every Day, and I Came across the API which I could use inorder to trigger the Job via an API Call, My sample RequestBody:{ "id": 12717, "version": 0, "username": "guyooz|samoosa", "label": "sample-1", "creationDate": "2021-08-24T11:19:14.949Z", "trigger": { "simpleTrigger": { "id": 12714, "version": 0, "timezone": "UTC", "startType": 2, "startDate": "2021-08-24 11:19", "misfireInstruction": 0, "occurrenceCount": -1, "recurrenceInterval": 1, "recurrenceIntervalUnit": "DAY" } }, "baseOutputFilename": "Sample", "outputLocale": "en_US", "outputTimeZone": "UTC", "source": { "reportUnitURI": "/dashboards/Sample", "parameters": { "parameterValues": { "StartDate": [ "1/2/2021" ], "EndDate": [ "6/2/2021" ] } } }, "outputFormats": { "outputFormat": [ "PDF" ] }, "repositoryDestination": { "folderURI": "/dashboards", "id": 12715, "overwriteFiles": true, "sequentialFilenames": false, "version": 0, "saveToRepository": true, "usingDefaultReportOutputFolderURI": false, "outputFTPInfo": { "userName": "anonymous", "type": "ftp", "port": 21, "implicit": true, "pbsz": 0, "propertiesMap": {} } }, "mailNotification": { "bccAddresses": { "address": [] }, "ccAddresses": { "address": [] }, "toAddresses": { "address": [ "axxx@xxx.com" ] }, "version": 0, "id": 12716, "includingStackTraceWhenJobFails": false, "messageText": "", "resultSendType": "SEND_ATTACHMENT", "skipEmptyReports": false, "skipNotificationWhenJobFails": false, "subject": "From Jasper Server Pro : Test email" }}The response error:{"message":"com.jaspersoft.jasperserver.api.engine.scheduling.domain.ReportJobSource cannot be cast to com.jaspersoft.jasperserver.api.engine.scheduling.domain.reportjobmodel.ReportJobSourceModel","errorCode":"unexpected.error","parameters":["java.lang.ClassCastException"]}Just FYI: I used the GET jobs API call, Took one of the JOBID, and did a GET API call with the JOBID specified in it, Took the response body. So there are no format issues.Kind of stuck right now due to this, Any help would be appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now