How to add total_time_spent in worklog using API
Please use milli-seconds as value to the attribute
URL: <URL>/api/v3/worklog?OPERATION_NAME=add&TECHNICIAN_KEY=XXXXXXXXXXXXX
JSON:
input_date={
"worklog": {
"request": {
"id": "6"
},
"description": "Adding a worklog",
"technician": {
"name": "administrator"
},
"total_time_spent": 720000,
"start_time": {
"value": 1421042555857
},
"end_time": {
"value": 1421042555857
}
}
}
Related Articles
Query to show total time spent for a ticket
PGSQL: SELECT wo.WORKORDERID AS "Request ID", aau.FIRST_NAME AS "Requester", cd.CATEGORYNAME AS "Category", scd.NAME AS "Subcategory", wo.TITLE AS "Subject", rtdef.NAME AS "Request Type", ti.FIRST_NAME AS "Technician", sdo.NAME AS "Site", ...
Script to add worklog using custom schedule
What is a Custom Schedule? Custom Schedules are actions scheduled on a specific date and time with or without repeat frequency. The actions are specified in a customized script file. Any data from ServiceDesk Plus can be sent to the script through ...
Query to show tickets that shows total time spent of the ticket more than x hours
Query to show tickets that shows total time spent of the ticket more than 8 hours: select ad.org_name "Account", sdo.name "Site", wo.workorderid "Request ID", au.first_name "Assigned Technician", cast((((sum(ct.timespent))/1000)/3600) as varchar(20)) ...
Add attachments using API
Attachment cannot be added when a request is created, it can be only added after request creation URL : http://localhost:8080/api/v3/attachments?TECHNICIAN_KEY=XXXXXXXXX Body
Query to show both requests and task worklog time spent together
DB : MSSQL Timespent for both tasks and requests select wo.workorderid "Request ID", aau.FIRST_NAME "Requester", cast((((sum(ct.timespent))/1000)/3600) as varchar(20)) +'Hrs '+cast(((((sum(ct.timespent))/1000)/60)) % 60 as varchar(20))+'Mins '+ ...