Query to fetch Task Worklog and related entity ID
DB Compatibility : PGSQL & MSSQL
Build Compatibility : Builds above 9400
SELECT taskdet.TASKID AS "Task ID", taskdet.TITLE AS "Title", taskowner.FIRST_NAME AS "Owner", taskdet.MODULE AS "Module", wotask.WORKORDERID AS "Request ID", taskprob.PROBLEMID AS "Problem ID", taskchange.CHANGEID AS "Change ID", taskproject.PROJECTID AS "Project Id",rctd.FIRST_NAME AS "Worklog Owner",LONGTODATE(ct.TS_STARTTIME) AS "Worklog Start time", LONGTODATE(ct.TS_ENDTIME) AS "Worklog End time", ct.DESCRIPTION AS "Worklog Description" FROM TaskDetails taskdet LEFT JOIN SDUser taskownersdu ON taskdet.OWNERID=taskownersdu.USERID LEFT JOIN AaaUser taskowner ON taskownersdu.USERID=taskowner.USER_ID LEFT JOIN WorkOrderToTaskDetails wototaskdet ON taskdet.TASKID=wototaskdet.TASKID LEFT JOIN WorkOrder wotask ON wototaskdet.WORKORDERID=wotask.WORKORDERID LEFT JOIN ProblemToTaskDetails probtotaskdet ON taskdet.TASKID=probtotaskdet.TASKID LEFT JOIN Problem taskprob ON probtotaskdet.PROBLEMID=taskprob.PROBLEMID LEFT JOIN ChangeToTaskDetails changetotaskdet ON taskdet.TASKID=changetotaskdet.TASKID LEFT JOIN ChangeDetails taskchange ON changetotaskdet.CHANGEID=taskchange.CHANGEID LEFT JOIN TaskToProjects projtotaskdet ON taskdet.TASKID=projtotaskdet.TASKID LEFT JOIN ProjectDetails taskproject ON projtotaskdet.PROJECTID=taskproject.PROJECTID LEFT JOIN TaskToCharge toc ON taskdet.TASKID = toc.TASKID LEFT JOIN ChargesTable ct ON toc.CHARGEID=ct.CHARGEID LEFT JOIN SDUser rcti ON ct.TECHNICIANID=rcti.USERID LEFT JOIN AaaUser rctd ON rcti.USERID=rctd.USER_ID WHERE (taskdet.CREATEDDATE >= <from_thismonth>) AND (taskdet.CREATEDDATE <= <to_thismonth>)
In the above query, you can replace the
<from_thismonth> and
<to_thismonth> with the desired date filter. You can look for the available list of date filters here -
Date Filter
New to ADSelfService Plus?
Related Articles
Task related reports (MSSQL)
Tested in MSSQL build (14306) Sample Output and headers present in this report Goto reports -> New query report and executes the following SELECT taskdet.TASKID AS "Task ID", taskdet.MODULE AS "Module", taskprior.PRIORITYNAME AS "Priority", ...
Query to show both task comments and worklog comments ( MSSQL )
Tested in MSSQL build (14306) SELECT "taskdet"."TASKID" AS "Task ID", "taskdet"."TASKID" AS "Task ID", "wotask"."WORKORDERID" AS "RequestID", cd.CATEGORYNAME AS "Request Category", "taskgroup"."QUEUENAME" AS "Group", "taskowner"."FIRST_NAME" AS ...
Option to cancel the pending tasks when Request is cancelled- when the worklog is mandatory
Requirement: Customer needs to close the tasks when the request is closed and the worklog is mandatory field in request closing rules. Download the attached scripts. Under Admin > Developer Space > Global Custom Function, create a new custom ...
Task Comments and Description
This report is used to find the task comments and Description. To make any changes to a query, refer to the KB article below. https://pitstop.manageengine.com/support/manageengine/ShowHomePage.do#Solutions/dv/24000633501275 SELECT taskdet.TASKID AS ...
Query to show Site and its related settings(MSSQL & PGSQL)
Tested in Build PGSQL (14300) or MSSQL (14306) Go to Reports-New Query Report and execute the query. select adef.org_name "Account Name",sdef.siteid "Site ID", sdo.name "Site Name", siteconf.settingdetail "Related Settings", CASE WHEN ...