Jobs: scheduling and lifecycle
Shift selected job starts by elapsed days
/a/Jobs_moveJobTime
Move each selected job's timestamp by a fixed number of 24-hour periods.
When to use this endpoint
Use the Jobs multi-edit Change Job date by n days action. For full dependent scheduling updates, use the time setter workflow instead.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Legacy edit-restriction bit 128 is enforced; client administrators retain the existing admin exception.
The primary job selection is tenant-scoped. There is no automatic schedule-conflict or assignee-ownership check. Cross-tenant follow-ups use persisted outsourcing context.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
days | Integer string | Yes | Nonzero integer count of elapsed 86400-second days, positive or negative. Fractions are truncated; 0 is an error. |
ids | Native/form array | Yes | Selected job IDs, integer-coerced. Empty list is an error. JSON strings are not decoded; use form ids[] for API-key requests. |
Example request
$result = FM_api('Jobs_moveJobTime', [
'ids' => ['1042', '1088'], 'days' => '2',
]);
Example response
{"errors":[]}
Successful response remains {"errors":[]}. Missing/invalid IDs and dates are reported before writes; persistence failure includes error/errors, failedId and updatedIds.
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: days"} | Omitted/zero after integer coercion. |
{"error":"missing or invalid parameter: ids"} | IDs omitted. |
{"error":"array empty: ids"} | No ID elements. |
{"error":"failed to get all jobs"} | At least one selected active job cannot be resolved; no writes. |
{"error":"missing or invalid parameter: meeting_time_e"} | Selected job has no positive stored start epoch. |
{"error":"Cannot set meeting time later than 2200"} | A resulting epoch exceeds the supported range; preflight prevents all moves. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Enforces edit restriction with the client-admin exception. Requires a nonempty native ID list, normalizes positive IDs and deduplicates it.
- Preloads and verifies every selected active job and all resulting timestamps before the first save. Missing/deleted jobs or zero start epochs now fail rather than being silently skipped.
- Adds days×86400 to each epoch; daylight-saving changes can still alter local clock hour. This remains an elapsed-day shift, not local-calendar-day preservation.
- Runs Job_setMeetingTime in input order, with completion-estimate, reminder, recurrence, snapshot, outsourcing and due-date follow-ups. Restores request/global context between jobs.
- The first nested save error stops the batch and returns the saved prefix. No batch-wide transaction or automatic retry; successful setter warnings are aggregated.
Side effects
- Same scheduling side effects as Job_setMeetingTime per job, including date-change email and optional sync-due-date-to-job-time behavior. There is no separate direct Jobs_move marker anymore.
See it in Fieldmotion
CRM1
Select jobs → Change Job date by n days → enter a signed day count and confirm. jobsMultiEdit.js posts a native ids array.
CRM2
The equivalent multi-edit action in lib/jobsMultiEdit.js uses the same ids/days payload.
Related endpoints
Job_moveshifts one start by elapsed minutes.Job_setMeetingTimeruns dependent scheduling updates.Jobs_setUsersAndTimesapplies a scheduler batch and reports saved prefixes.