restjasperserver

How to schedule a job generating report with JasperServer rest api with "Run Immediate" option


I'm trying to find out how to set all options of scheduling report in JasperServer with REST API.

I found that I can set simple trigger with XML

<simpleTrigger>
  <startDate>2020-08-10 16:26</startDate>
  <startType>2</startType>
  <timezone>Europe/Warsaw</timezone>
  <occurrenceCount>1</occurrenceCount>
  <recurrenceInterval>1</recurrenceInterval>
  <recurrenceIntervalUnit>DAY</recurrenceIntervalUnit>
</simpleTrigger>

and i know how to configure it to schedule it every 2 days for example

Then we have calendar trigger

<calendarTrigger>
    <startDate>2020-08-20 00:00</startDate>
    <startType>2</startType>
    <timezone>Europe/Warsaw</timezone>
    <daysType>MONTH</daysType>
    <hours>0</hours>
    <minutes>0</minutes>
    <monthDays>1,2</monthDays>
    <months>
        <month>1</month>
        <month>2</month>
    </months>
</calendarTrigger>

When we use JasperServer WebUI we can set "Immediately" start option. I can't find how to set that option with REST API. Is there a list of all options somewhere?


Solution

  • Set startdate to null and startType to 1 (now)

    "trigger": {
        "simpleTrigger": {
            "endDate": null,
            "occurrenceCount": 1,
            "recurrenceInterval": null,
            "recurrenceIntervalUnit": null,
            "startDate": null,
            "startType": 1,
            "timezone": "Europe/Warsaw"
        }
    }