Scheduled tasks
Create generation rule#
You can create a rule for generating tasks, set the period for the rule to work, frequency and time of execution.
Request body:
| Attribute | Type | Description | Nullable |
|---|---|---|---|
| name | String | Name of the rule and of the tasks it generates | false |
| active | Boolean | Whether the rule is active | false |
| activeFrom | ISO DateTime | Date and time from which the rule will be executed Format yyyy-MM-dd'T'HH:mm:ss.SSS'Z' | false |
| activeTo | ISO DateTime | Date and time when the rule will stop executing Format yyyy-MM-dd'T'HH:mm:ss.SSS'Z' | false |
| scheduledTime | Time | Time when the rule will start, in HH:mm format | false |
| generationRule | Object | Defines how often the rule runs See Generation rule object | false |
| taskType | Enum of string | Type of the task. Available types: COMMON, SURVEY, PHOTO_REPORT | false |
| description | String | Task description | false |
| customObservers | List objects | Custom observers for the task. See Observer object | true |
| daysToComplete | Integer | Number of days to complete the task | false |
| executors | Object | See Executors object | false |
| executorCommentRequired | Boolean | Whether the executor is required to leave a comment | false |
| formTemplateId | String | Identifier of the survey template. Required for the SURVEY task type | true |
| loadFromGalleryProhibited | Boolean | Prohibit uploading photos from the gallery | false |
| minAttachmentsCount | Integer | Minimum number of attachments the executor must add | false |
| notificationPeriod | Enum of string | Frequency of reminders for executors: daily, weekly, deadline, dayBeforeDeadline | false |
| notifications | List objects | Custom notification settings for the task. See Notification object | true |
| observersEnabled | Boolean | Whether observers are enabled for the task | false |
| needApproval | Boolean | Whether the task requires approval after completion | false |
| withManyExecutors | Boolean | Controls how responses are created when a store (object) has several matching executors.true โ a single shared response is created per store for all its executors, so the task needs to be completed only once.false โ a separate response is created for each executor, and every executor must complete their own. | true |
Response
Returns Task template object
Examples
200 OK
Find generation rules#
Finds task generation rules matching the given filters
Request parameters:
| Request Parameter | Type | Description | Required |
|---|---|---|---|
| active | Boolean | Find by active state | false |
| name | String | Find by name | false |
| periodicity | List of strings | Find by periodicity | false |
| days | List of integers | Find by periodicity days, required if the periodicity filter is set | false |
| months | List of integers | Find by periodicity months, required if the periodicity filter is set | false |
| authors | List of integers | Find by author ids | false |
| executors | List of integers | Find by executor ids | false |
| divisionIds | List of integers | Find by division ids | false |
| regionIds | List of integers | Find by region ids | false |
| shopIds | List of integers | Find by store ids | false |
| type | Set of string | Find by task types, default all types | false |
Response
Returns a list of Task template objects
Examples
200 OK
Delete task generation rule#
Deletes the task generation rule
Examples
200 OK