Cutover API
>
Examples
>
How to get a list of task types from a runbook

How to get a list of task types from a runbook

This example shows you how to retrieve a list of tasks based on a certain task type.

1. Get a runbook’s tasks

Let’s make an authenticated call to the List Tasks in a Runbook  endpoint. In this example, the runbook ID we will use is 1884. 

We will need to use the request URL below:

https://api.client_name.cutover.com/core/runbooks/1884/tasks

2.Create a list that filters by task type

Next, let’s filter the runbook by milestone tasks. In order to do this, we will need to use the List Task Types endpoint. The request URL will look like this:

https://api.client_name.cutover.com/core/task_types

Once we have executed the API call, we will see that a milestone task type has an ID of 2. To filter the runbook by milestones, we will need to enter the runbook_id which is 1884 and the task_type_id which is 2 into the following request URL:

https://api.client_name.cutover.com/core/runbooks/1884/tasks?sort=start_planned&task_type_id=2

The API response will return a list of milestone tasks.