Job Management
Access detailed job information including customer details, scheduling, status history, and service tasks.
Table of contents
Getting Job Details
The primary method for accessing detailed job information is getJobDetail(), which returns complete job data including customer information, scheduling details, status history, and associated assets:
val result = zync.jobs.getJobDetail("job_550e8400-e29b-41d4-a716-446655440000")
when (result) {
is GetJobResult.Success -> {
val job = result.data
println("Job: ${job.jobTitle}")
println("Work Order: #${job.workOrderNumber}")
}
is GetJobResult.Failure -> {
println("Failed to get job: ${result.error.message}")
}
}
let result = try await zync.jobs.getJobDetail(jobUid: "job_550e8400-e29b-41d4-a716-446655440000")
switch onEnum(of: result) {
case .success(let success):
let job = success.data
print("Job Title: \(job.jobTitle)")
print("Work Order: #\(job.workOrderNumber)")
case .failure(let failure):
print("Error: \(failure.error.message)")
switch onEnum(of: failure.error) {
case .network:
print("Check your internet connection")
case .error(let error):
print("Error: \(error.message)")
if let code = error.code {
print("Error code: \(code)")
}
}
}