Logging Work via the API
Record work logs programmatically through the API.
Due to our privacy-first approach, detailed in this article, you must use the Jira REST API to create work logs. When creating work logs, you can also include JetTime-specific metadata as part of the work log properties. For details on JetTime metadata, refer to JetTime Work Log Metadata article.
To create work logs, refer to the Jira API documentation for creating work logs via POST.
Example JSON Body
{
"comment": {
"content": [
{
"content": [
{
"text": "I did some work here.",
"type": "text"
}
],
"type": "paragraph"
}
],
"type": "doc",
"version": 1
},
"started": "2025-01-02T13:04:16.208+0000",
"timeSpentSeconds": 3600,
"properties": [
{
"key": "jettime",
"value": {
"schemaVersion": 2,
"timeSpentSeconds": {
"BILLABLE": 600
},
"fields": {
"EXPENSE": 240.45,
"INTERNAL": false,
"WORK_TYPE": "Consulting"
},
"account": {
"name": "Acme Corp",
"key": "ACME"
}
}
}
]
}Explanation of Key Fields
- BILLABLE: This key under
timeSpentSecondsrepresents a custom time category. Custom time category keys, such asBILLABLE, are defined in the JetTime app UI when you create the category, along with its other parameters (e.g., display name and attributes). - fields: These keys represent custom work log fields configured in the JetTime app UI. Each key, such as
EXPENSE,INTERNAL, orWORK_TYPE, is defined in the UI when the custom work log field is created, alongside its type (e.g., numeric, text, boolean):EXPENSE: Tracks financial expenses in numeric values.INTERNAL: A boolean field indicating whether the work is internal or external.WORK_TYPE: A text field describing the type of work performed (e.g., "Consulting").
- account: Represents the client or project account, defined in JetTime's account management section, with attributes like
nameandkey.
The work log author is the native Jira author, the account the work log is created as. To log work for someone else, see Managing Work Logs for Others via the API.
Using this example, you can seamlessly integrate JetTime's metadata into your Jira work logs while maintaining privacy and flexibility for your time tracking needs.