What's new
- A service can carry a service checklist.
checklistTemplateIdon a service names an active checklist of type Service in your organisation. Any other checklist is refused with a 422 (checklist_template.not_serviceorchecklist_template.service_inactive). - Default service checklists. Equipment and groups take
defaultServiceChecklistTemplateId. The equipment's own default comes first, then its group's. GET /api/v1/services/checklist-default?equipmentId=tells you a machine's default service checklist, so you can send it aschecklistTemplateId.- The service detail returns
checklistTemplate(the checklist and its items) andchecklistResponses(the recorded answers). POST /api/v1/services/:id/completetakeschecklistResponses: one answer per item, each withchecklistItemId,response(PASS,FAILorNA), and an optionalvalue,notesandphotoUrls.
What you need to change
A default is never applied for you. A service you create without a checklistTemplateId has no checklist, as before, even when the machine or its group has a default. To use the default, read it from GET /api/v1/services/checklist-default and send it as checklistTemplateId, as the console does.
Completing a service with a checklist needs its answers. On such a service:
POST /api/v1/services/:id/completewithout an answer to every required item returns 422service.checklist_incomplete.error.details.missingItemIdslists the items still to answer.POST /api/v1/services/:id/transitionwithtoStatus: COMPLETEDreturns the same 422, because it carries no answers. Complete these services through/completeinstead.- An answer for an item that isn't on the service's checklist (
service.checklist_item_not_in_checklist), or the same item twice (service.checklist_duplicate_answer), is also a 422.
If your integration completes services, read checklistTemplate on the service first. When it isn't null, send checklistResponses with /complete.
A back-dated service carries no checklist. A service you create directly as COMPLETED can't name one: that is refused with a 422 (service.completed_log_checklist), because no answers can be added to it later. Create the service as UPCOMING with the checklist, then complete it with the answers.
Also changed
- A defect-repair service must be for a defect on the same machine.
POST /api/v1/serviceswithtrigger: DEFECT_REPAIRand adefectIdof another machine is refused with a 422. Completing the service resolves that defect, so the two must match. - A repair that fails a critical checklist item leaves its defect open. When a
DEFECT_REPAIRservice is completed and its checklist answersFAILon a critical item, the service still completes with every answer, but its defect is not resolved: it keeps its status, gets a comment naming the failed items, and takes the machine out of service until it's closed if nothing had already (a technician's lockout stays theirs), and your organisation's managers are notified. A failed critical item the defect isn't about gets a defect of its own, as on any other service (below). - A critical checklist item that fails on any other service raises a defect. When a service that isn't a defect repair is completed and its checklist answers
FAILon a critical item, the service still completes with every answer, and the item gets a defect: the machine's open defect for that item, or a newCRITICALone whose description names the service. That defect takes the machine out of service until it's closed, so every pre-start on it fails until then, and your organisation's managers are notified. A new defect sends thedefect.reportedwebhook. - A hired machine's service history is open to the organisation operating it. The hiring organisation now sees each service's people, completion notes, status changes and checklist answers. The costs, currency, invoice number and the assigned and performing companies stay with the owner, and are null for the hirer.
Unchanged
- Services with no checklist complete exactly as before.
- A service you create without a
checklistTemplateIdhas no checklist, as before.