Create a job
create_jobCreate a job for a customer. This writes to the user's live system and other people will act on it, so state the customer, the site, the work and any time back to the user and get their agreement BEFORE calling this. Take customer_id and location_id from find_customer; never guess either. A job with no site is a job nobody can be sent to, so when the customer has more than one, agree which before calling rather than letting it default. The job is created in its customer's brand (a project's unit, in the project's), and its template must come from that brand too; when the user named a brand, pass it as brand so a mismatch is refused rather than landing the job elsewhere. Report the job number, its brand and every entry in warnings back to the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brand | No | The brand the user wants this job in, by id or name. Optional: the job always goes in the brand of its customer (or project), and naming a different one is refused, so pass it when the user named a brand to have that checked. | |
| notes | No | Anything else the user said. | |
| title | Yes | Short description of the work, as the user described it. | |
| priority | No | T_NORMAL | |
| project_id | No | From find_project. Creates this job as a unit of that project, inheriting its customer, brand and default location. | |
| customer_id | No | From find_customer. Never guess or construct this. Required unless project_id is given, in which case the project's own customer is used. | |
| location_id | No | The site the work happens at, from the `locations` of the customer returned by find_customer. Must be one of that customer's sites. Leave it out to use their primary site. | |
| template_id | No | Job template to create against, when the tenant uses one. | |
| custom_fields | No | Tenant-defined fields, keyed by field key. | |
| scheduled_end | No | ||
| scheduled_start | No |