How to get a job number

Originally posted by Huzaifa

I am a developer and making application for my client intergetaing serviceM8.
My client asked to to show job number not the uuid in the application.

But serviceM8 api/sdk providing me only uuid not any job Number.
{
“uuid”: “2563edf2-9cd0-421f-98ed-769ae312d64b”,
“active”: 0,
“date”: “2015-08-22 00:00:00”,
“job_address”: “MCG, Brunton Avenue, East Melbourne, Victoria”,
“billing_address”: “MCG, Brunton Avenue, East Melbourne, Victoria”,
“status”: “Completed”,
“quote_date”: “2015-08-22 03:35:40”,
“work_order_date”: “2015-08-22 03:35:41”,
“work_done_description”: “Use this for storing work done on the job.\r\n\r\n Create your invoice here, new items will be automatically added to your material list.”,
“lng”: 144.9827562,
“lat”: -37.8210056,
“generated_job_id”: “SAMPLE”,
“completion_date”: “2015-08-23 18:31:45”,
“completion_actioned_by_uuid”: “9e22be9e-517a-4653-8ea7-34fa1582196b”,
“unsuccessful_date”: “0000-00-00 00:00:00”,
“payment_date”: “0000-00-00 00:00:00”,
“payment_method”: “”,
“payment_amount”: 0,
“payment_actioned_by_uuid”: “”,
“edit_date”: “2015-08-24 18:04:15”,
“geo_is_valid”: 1,
“payment_note”: “”,
“ready_to_invoice”: “0”,
“company_uuid”: “df8536bf-20c2-44da-8f06-e4f03a3bfadb”,
“geo_country”: “Australia”,
“geo_postcode”: “”,
“geo_state”: “VIC”,
“geo_city”: “East Melbourne”,
“geo_street”: “Brunton Avenue”,
“geo_number”: “”,
“payment_processed”: 0,
“payment_processed_stamp”: “0000-00-00 00:00:00”,
“payment_received”: 0,
“payment_received_stamp”: “0000-00-00 00:00:00”,
“total_invoice_amount”: “250.0000”,
“job_is_scheduled_until_stamp”: “0000-00-00 00:00:00”,
“category_uuid”: “4b1b5c2b-4ca8-4490-b529-c12d8f7508fb”,
“queue_uuid”: “”,
“queue_expiry_date”: “0000-00-00 00:00:00”,
“badges”: “”,
“invoice_sent”: false,
“purchase_order_number”: “14323”,
“ready_to_invoice_stamp”: “0000-00-00 00:00:00”,
“invoice_sent_stamp”: “0000-00-00 00:00:00”,
“active_network_request_uuid”: “”,
“queue_assigned_staff_uuid”: “”,
“quote_sent_stamp”: “0000-00-00 00:00:00”,
“quote_sent”: false,
“customfield_groundplan”: “”,
“customfield_proj_manager”: “”,
“customfield_job_documents”: “”,
“customfield_job_info_groundplan”: “”,
“customfield_proj_manager_email”: “”,
“customfield_job_info_sharepoint”: “”,
“customfield_project_plan”: “”,
“customfield_job_name”: “”,
“customfield_contractor_company”: “”,
“customfield_cut_n_strip_date”: “0000-00-00”,
“customfield_light_install_date”: “0000-00-00”,
“customfield_certificates_received”: “”,
“customfield_handover_date”: “0000-00-00”,
“customfield_rough_in_date”: “0000-00-00”,
“customfield_fit_off_date”: “0000-00-00”,
“customfield_lighting_order_required”: “”,
“related_knowledge_articles”: false,
“job_description”: “Welcome!\r\n\r\n This is the job card, where all information for this job is stored.\r\n\r\n Description is used to to outline what has to be done at the job.”,
“created_by_staff_uuid”: “9e22be9e-517a-4653-8ea7-34fa1582196b”
},

here is the sample. can you guide me plz.

Hi Huzaifa,

Looking at your job response data, I can see the job number you’re looking for is actually in the ‘generated_job_id’ field. This is the human-readable job number that appears in the ServiceM8 interface.

In your example response, the generated_job_id is set to “SAMPLE”, but in real jobs this will contain the actual job number. You should use this field instead of the UUID when displaying job numbers to users.

The UUID should still be used for all API operations and data relationships, but the generated_job_id is perfect for display purposes.

Thanks,
Cody

Thanks Cody. Can a custom Job Text field, such as customfield_restate_reference, be used as a merge field in ServiceM8’s native Word quote/invoice templates and email/SMS templates? If so, what is the exact merge syntax for each?

Hi Tom,

Yes, a Job Text custom field can be used in Word quote/invoice templates and native email/SMS templates, provided you use its exact field code. For your example:

  • Word quote/invoice template: insert a Microsoft Word MergeField named job.customfield_restate_reference. Word will display it as «job.customfield_restate_reference», but don’t type the chevrons manually.
  • Email body or subject: {job.customfield_restate_reference}.
  • SMS template: {job.customfield_restate_reference}.

For Word, use Insert > Quick Parts > Field > Mail Merge > MergeField on Windows, or Insert > Field on Mac. For email and SMS templates, use the available field picker where possible so the code is inserted exactly.

The field code must match the custom field’s internal name, including the customfield_ prefix.

Thanks,
Cody