How to update custom fields in a task

This example shows you how to update a custom field associated with a task, without needing to go into Cutover to manually update them.

1. Get a runbook's tasks

With an authenticated call, we can use the List Tasks in a Runbook endpoint. The request URL is shown below:

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

2. Update each task

Let’s update the custom field in the task below:

We are looking to update task ID #58 which is in a runbook with an ID of 1886. We are updating the custom field Job name which will have a custom field value of New Jenkins Job

To make this change, we can use the Update a Task endpoint. The request body can be found below:

{
 "data": {
   "type": "task",
   "attributes": {
     "name": "Check connection to source app server",
     "custom_field_values": [
        { 
         "name": "Job name",
         "value": "New Jenkins Job"
        }
      ]
    }
  }
}

Once we have made the API call, this is how the update would look in Cutover: