Delete Tasks

Delete Tasks

Requirement:  Delete all tasks.

UseCase:  Deleting tasks with task id less than a particular count.

Please follow the below steps. 
  1. Goto Reports > New Query Report > execute the query and save it with a name.
    1. select taskid, helpdeskid "portaild" from taskdetails where taskid < 300
    2. All tasks with task id less than 300 will be deleted.  This can be modified as per your requirement.
    3. Execute the query and save the report with a name. [Report name: deletetask]
  2. Goto Admin > Custom Schedule Function > Global Function > New > Paste the global function contents and save it with a name.
    1. Update the URL and integration key in the script. 
    2. You can get the integration key under Admin > Integrations > Integration Key > New
    3. Please use an integration key with admin privilege, as there wont be any role related permission issues. 

    4. Update the integration key in the global function.

  3. Goto Admin > Custom Schedule Functions > New > Paste the content from Delete_task.txt and save it with a name

  4. Configure a custom schedule to invoke the created custom function with the query report as parameter. 
    1. Note:  We can configure this on repeat mode if the task count is huge.




                  New to ADSelfService Plus?

                    • Related Articles

                    • Project,Milestone and Tasks.

                      DB Compatability: PgSQL and MSSQL SELECT projectdet .PROJECTID "Project Id",        projectdet.TITLE "Project Title",        projectstatus.STATUSNAME "Project Status",        projectowner.FIRST_NAME "Project Owner",       ...
                    • Query to show PM task details with Next schedule and last ran time (MSSQL & PGSQL)

                      Tested in Build PGSQL (14300) or MSSQL (14306) Next schedule time : SELECT swo.WORKORDERID "PM Task ID", adef.org_name "Account", sdo.name "Site", ti.SCHEDULE_TIME "Next Schedule Time", aau.FIRST_NAME "Requester", dpt.DEPTNAME "Department", ...
                    • Script to Auto close Preventive Maintenance Requests

                      This post describes the use of a python script to close  Preventive maintenance Requests using Custom Schedules. What is 'Custom Schedules'? The Custom Schedules feature enables you to access any data in ServiceDesk Plus to perform customized actions ...
                    • Workaround for #8808907: Skip schedule on Delete flag exception

                      Fix: This fix should be given only for 8808907 customer and for 14204 build. The fix is to skip the current mail fetching schedule on occurrence of any delete flag exception. This fix is compatible with only 14204 build. Steps to apply the fix: 1. ...
                    • Setting the Request Due Date as the Schedule End Date for All Associated Tasks

                      Requirement: Request DuebyDate has to be set as the schedule end date for all the tasks associated to the request. Steps to follow: Goto Admin > Developer Space > Global function > New > Paste the content from the attachment Global function_4.txt and ...