Add tasks with dependencies for a change request created with a particular template

Add tasks with dependencies for a change request created with a particular template

Requirement:
Add tasks with dependencies for a change request created with a particular template.

UseCase:
Four Predefined tasks will be added to every change request created with "Maintenance" Template.
Task Details:
  1. Scheduling Snapshots
  2. Linux Patching
  3. DBA Patching
  4. Configuring Maintenance mode in OpManager
"Linux Patching" task and "DBA Patching" task are dependent on "Scheduling Snapshot" task.

The tasks would be assigned to the same group and technician as in the change request.  So its mandatory for the change request to have a group and change owner to get this script working.

Steps to follow:
  1. Goto Admin > Developer Space > Global function > New > Paste the content from the attachment  Global_function_4.txt  and save it with a name.
  2. Update the URL and integration key in the script. 
    1. You can get the integration key under Admin > Integrations > Integration Key > New
    2. Please use an integration key with admin privilege, as there wont be any role related permission issues. 

    3. Update the integration key in the global function.

  3. Go to Admin > Developer Space > Global Functions > New > Paste the content from the attachment addTasks.txt  and save it with a name.

  4. Go to Admin > Developer Space > Global Functions > New > Paste the content from the attachment createTaskDependencies.txt  and save it with a name.

  5. Go to Admin > Developer Space > Change Custom Functions. Create a new function.
    1. Refer to the attached script. (customFunction.txt.)
    2. Update the global function count in the script as per your instance.
  6. Configure Change custom trigger to get executed on every Change being created with a "Maintenance" template.  Invoking condition can be modified as per your requirement.





                  New to ADManager Plus?

                    New to ADSelfService Plus?

                      • Related Articles

                      • How to automatically create multiple tasks in a change request with a configurable JSON file.

                        Note:  Attached script will not work beyond 11138 SDP Version. ​ This is a sample Python script  to automatically  create multiple tasks within a change request  with a configurable JSON file. This is achieved  using an API call to create a task in ...
                      • How to assign CAB members to a change request automatically.

                        Note:  Attached script will not work beyond 11138 SDP Version. ​ This is a sample script to add CAB Members to a Change Request through Change Custom Triggers.The CAB Members can only be added manually to the Change Request ,under the Approval Tab, ...
                      • Add Approvals to request when all the associated tasks are completed.

                        Requirement: Request approvals have to be added only after all the associated tasks of a request are completed. If the approvals are added via the request workflow, then it would be automatically triggered when a request is created. To avoid this, we ...
                      • Add and trigger predefined tasks to a request

                        Requirement: Add a set of tasks to a request and trigger them all at once. Steps to configure: Goto Admin > Developer Space > Global function > New > Paste the content from the attachment GF_4 - Configuration.txt  and save it with a name. Update the ...
                      • Incident and Service Catalog Template Frequency

                        1 . This report is used to find the most used template in the application.   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 ...