Olympus-Zendesk Budget Sync
A unified script that syncs Olympus project budget data and displays it in Zendesk ticket headers and on the Olympus Budget Dashboard. Runs on all three sites using cross-domain storage.
How It Works
This single script runs on Olympus, Zendesk, and the Olympus Budget Dashboard on this site, using Tampermonkey's cross-domain storage capabilities (via GM.setValue and GM.getValue) to share data between them.
On Olympus
The script automatically intercepts GET requests to the projects widget API endpoint (/api/projects/widget). When a response is received, it extracts client budget information and stores it in Tampermonkey's storage, making it available across domains. It also records the time of the capture.
On Zendesk
The script monitors ticket pages for organisation information. When you open a ticket, it:
- Reads the organisation name from the ticket header
- Retrieves stored budget data from Tampermonkey's storage
- If a match is found (case-insensitive), displays a budget information badge in the ticket header
- The badge shows the client name, the days booked and scheduled, and a two-bar chart
On the Budget Dashboard
Tampermonkey's per-script storage cannot be read by ordinary page JavaScript, so the Olympus Budget Dashboard cannot work on its own. On that page the script renders nothing itself; instead it:
- Posts the stored budget data and capture time to the page as soon as it loads
- Posts it again whenever the page asks for it, so the handshake works whichever side is ready first
Without the script installed, the dashboard shows an explanatory message instead of any data.
Data Stored
For each project in the API response, the script stores:
- clientName: The name of the client
- projectName: The name of the project
- daysBooked: The number of days booked for the project
- daysScheduled: The number of days scheduled for the project
A capture timestamp is stored separately, so the dashboard can show when the data was last synced.
Console Commands (Olympus)
Open your browser's developer console (F12) on Olympus to access debugging commands:
olympusBudgetSync.view() // View the currently stored budget data
olympusBudgetSync.raw() // View the last raw API response, exactly as returned
olympusBudgetSync.help() // Show help message
Budget Display (Zendesk)
When a match is found, a badge appears in the ticket header showing the matched organisation name, the days booked, and the days scheduled (or "no budget" where none is set), followed by a small two-bar chart:
- Budget: How much of the scheduled budget has been booked, with a marker at 100%. The bar extends past the marker and turns red when the budget is exceeded.
- Month: How far through the current month you are, measured in working days (Monday to Friday). Bank holidays are not accounted for.
The budget bar is coloured by how it compares with month progress — green when comfortably behind, blue when on track, orange when running ahead, and red when over budget.
The badge is styled with a light blue background and appears in the navigation bar alongside other ticket information.
Requirements
- The script must be installed in Tampermonkey (not Greasemonkey, as it uses the newer
GM.*API) - You must visit Olympus whilst the script is active to populate the initial data
- Budget data is automatically updated whenever you visit Olympus and the API is called
Technical Notes
This script uses the newer GM.setValue and GM.getValue API (instead of the older GM_setValue/GM_getValue) which allows for cross-domain data sharing when the script has multiple @match directives.