Is it possible to add a custom action to the dropdown beside an attachment in the job diary, alongside “Remove”?
I’m building a customer portal and would like to add “Show in Client Portal” so staff can make a file visible to the customer directly from the diary, without opening a separate add-on and selecting the file again.
Is there a way to do this through the Add-on SDK, or is there any other possible approach?
If it’s not currently available, it would be a useful addition for our use case, and I’m sure plenty of other integrations would benefit from being able to run actions directly on diary attachments.
Hi Hayden,
The Add-on SDK doesn’t currently support adding custom actions to an attachment’s dropdown in the Job Diary, so you can’t place “Show in Client Portal” alongside “Remove”. The supported UI extension points are Job Actions, Client Actions and Menu Items.
The closest supported approach is a Job Action that opens a file-sharing picker for the current job:
Add a job-level action such as “Manage Portal Files”. On the web, it can open as a modal inside ServiceM8 rather than sending staff to a separate portal page.
Use eventArgs.jobUUID from the action event to retrieve that job’s attachments through GET /api_1.0/attachment.json, filtering on related_object eq 'job' and related_object_uuid eq '<job-uuid>' and active eq 1. This endpoint requires the OAuth scope read_attachments.
In your picker, let staff choose which files to share, and store that selection in your portal against each attachment’s uuid. This is a suggested design for your integration.
That still requires staff to select the file within your add-on, rather than acting directly on the diary attachment, but it keeps the workflow tied to the job they’re already viewing.
The relevant references are the Manifest Reference and List all Attachments.
Thanks,
Cody