Worklog Webhook
Use case overview
By creating a webhook, the worklog fields can be sent as payload to an API or an HTTP request-catching application in real-time.
This article provides an overview of how to set up and use worklog webhooks for efficient data transfer.
Setting up worklog webhooks
A worklog webhook can be triggered based on worklog events in the tickets and activities modules.
To learn more about worklog events captured by webhook, refer to this link.
Worklog payload
When creating a webhook, there are two payload options available:
- Default - Sends the worklog fields in a predefined structure.
- Advanced - Allows for customization of the payload structure, which is often framed in JSON format.
To learn more about webhook creation and its features, refer to this link.
Worklog fields that are available to choose from the default and advanced options are as follows:
S. No | Default fields | Properties | Placeholders in Advanced option |
---|---|---|---|
1. | Activity ID | - | {{worklog.ActivityId}} |
2. | Brand | ID, Name |
{{worklog.Brand.Id}} {{worklog.Brand.Name}} |
3. | Created By | User ID, Email ID |
{{worklog.CreatedBy.UserId}} {{worklog.CreatedBy.EmailId}} |
4. | Created Time | - | {{worklog.CreatedOn}} |
5. | Description | - | {{worklog.Description}} |
6. | Is Billable | - | {{worklog.IsBillable}} |
7. | Last Modified By | User ID, Email ID |
{{worklog.LastModifiedBy.UserId}} {{worklog.LastModifiedBy.EmailId}} |
8. | Last Modified Time | - | {{worklog.LastModifiedOn}} |
9. | Module ID | - | {{worklog.ModuleId}} |
10. | Time Spent | - | {{worklog.TimeSpent}} |
11. | Ticket ID | - | {{worklog.TicketId}} |
12. | Work Log Date | - | {{worklog.WorkLogDate}} |
13. | Work Log ID | - | {{worklog.Id}} |
Note:
- The Activity ID has a value only when worklog events are triggered in the Activities module; otherwise, it is null.
- The Ticket ID & Brand have a value only when worklog events are triggered in the Tickets module; otherwise, they are null.
- The Time Spent field is represented in minutes.
- All date and time fields are in the UTC zone.
Trigger worklog webhook conditionally
S. No | Condition | Operator | Value | Description |
---|---|---|---|---|
1. | Module | Is In |
Ticket Activity |
To differentiate worklogs from the tickets and activities module. |
Sample payload
Default option
When all fields are included, the payload sent for a Created event might resemble the below,
{
"eventModule": "WorkLog",
"eventType": "WorkLogCreated",
"eventTime": "2024-01-11T09:18:40.5534259Z",
"orgId": 1,
"orgName": "Phoenix Solutions",
"payload": {
"id": 1011,
"workLogDate": "2024-01-11T09:18:40.5534259Z",
"timeSpent": 60,
"ticketId": 10119,
"moduleId": 1,
"lastModifiedOn": "2024-01-11T09:18:40.5534259Z",
"lastModifiedBy": {
"userId": 132,
"emailId": "Alice.Walker@phoenix.com"
},
"description": "<p><span style=\"background-color: unset; color: var(--color-sf-text-primary); text-align: inherit;\">Work done:</span></p><p><span style=\"background-color: unset; color: var(--color-sf-text-primary); text-align: inherit;\">Collaborated with the development team to plan new features for our flagship product. </span></p><p><span style=\"background-color: unset; color: var(--color-sf-text-primary); text-align: inherit;\">Conducted thorough code reviews, resolved merge conflicts, and optimized database queries for improved performance.</span></p>",
"createdOn": "2024-01-11T09:18:40.5534259Z",
"createdBy": {
"userId": 132,
"emailId": "Alice.Walker@phoenix.com"
},
"brand": {
"id": 2,
"name": "Flagship-Product"
},
"isBillable": true,
"activityId": null
}
}
Advanced option
The Custom Payload text area available under the advanced option lets you input your customized payload and insert preferred worklog data from the placeholder section. This section appears when you click on Insert Placeholders.