Close task

This endpoint is used to close a task.

Leave Feedback

URL

POST https://{api-url}/api/v2/tenants/{clientId}/tasks/{taskId}/close

Sample URLs

https://{api-url}/api/v2/tenants/client_8/tasks/TASK0000000378/close

Parameters

FieldData TypeDescription
reasonStringProvide reason for changing the status. This is mandatory only if the option Enable reasons to change status Close is enabled for tasks in service desk settings. See below steps for more information.
notesString(Optional) Additional information to provide to a task.

Perform these steps prior to closing a task:

  1. To enable the option to provide reason for closing a task: Log into OpsRamp.
    1. Click Setup.
    2. On the left-hand side panel, click Service Desk.
    3. In Configuration, click Settings.
    4. Select client and then click Customize.
    5. In Tasks Settings section, select option Enable reasons to change status Close and then click Save.
  2. Check the status flow transition for Closed.
    1. Click Setup.
    2. On the left-hand side panel, click Service Desk.
    3. In Configuration, click Status Flows.
    4. Check the status flow for the entity Tasks and check the transition of the status Closed. If Closed is unavailable, this indicates the task cannot be closed.
  3. Provide the reason for changing the status:
    1. Click Setup.
    2. On the left-hand side panel, click Service Desk.
    3. In Configuration, click Status Change Reasons.
    4. Click Add,
    5. Select the scope, client, request type and entity status as Closed, provide the reason and click Submit.
  4. Use Get Task API to check if status Closed and reasons to provide for Close are enabled. In sample response, in the field allowedStatus if name: Closed and reasonsEnabled: true, this indicates reasons should be provided for closing a task.
  5. Use the Get status change reasons API to provide reasons to Close. Only status: Closed reason is accepted, any other reason would result in an error.

Status code

200 OK

Sample request

{
	"reason": "Project Integration Completed",
	"notes": "Project structure integration shared with the admin team and architect team."
}

Sample response

{
	"id": "TASK0000000378",
	"subject": "Integrate project",
	"description": "Project structure needs to be integrated",
	"status": "Closed",
	"oldStatus": "On Hold",
	"priority": "High",
	"oldPriority": "High",
	"notes": "Project integration shared with the admin team and architect team.",
	"closedSummary": "Project integration done for Logix service desk.",
	"requester": {
		"loginName": "john.smith",
		"lastName": "smith",
		"firstName": "john",
		"email": "john.smith@gmail.com",
		"phoneNumber": "998-559-1234"
	},
	"assignedUser": {
		"id": "USR0000000011",
		"loginName": "brocadeInc@organization.com",
		"lastName": "Inc Admin",
		"firstName": "Brocade",
		"email": "sample@gmail.com",
		"phoneNumber": "8096250653"
	},
	"assigneeGroup": {
		"id": 5,
		"name": "Brocade Inc Users",
		"description": "Brocade Partner Users"
	},
	"resources": [{
			"id": "d628b4f1-37ad-49de-8487-43125ec3178a",
			"name": "SJLPT204",
			"type": "DEVICE"
		},
		{
			"id": "SGP-c2af3866-fc89-47dd-b83f-bcc8df0b2a0a",
			"name": "VTH Services",
			"type": "SERVICE"
		},
		{
			"id": "DGP-420a80f4-5fba-46d5-a1c1-20e2df4a326a",
			"name": "OPSRAMP-SJ",
			"type": "DEVICE_GROUP"
		}
	],
	"customFields": [{
			"id": "UDF0000003797",
			"classCode": "TASK",
			"displayLabel": "API-Lab-Drop-Down",
			"name": "api_lab_drop_down_3797",
			"fieldType": "TYPE_DROPDOWN",
			"mandatory": false,
			"editable": true,
			"description": "Test field",
			"options": [{
					"label": "first",
					"value": "1"
				},
				{
					"label": "second",
					"value": "2"
				}
			],
			"value": "2",
			"defaultValue": "",
			"selectedOption": {
				"label": "second",
				"value": "2"
			}
		},
		{
			"id": "UDF0000003798",
			"classCode": "TASK",
			"displayLabel": "API-Lab-Text",
			"name": "api_lab_text_3798",
			"fieldType": "TYPE_TEXT",
			"mandatory": false,
			"editable": true,
			"description": "Text Field",
			"value": "testing text field-update",
			"defaultValue": "Text field"
		},
		{
			"id": "UDF0000003799",
			"classCode": "TASK",
			"displayLabel": "API-Lab-Multi-Line-Text",
			"name": "api_lab_multi_line_text_3799",
			"fieldType": "TYPE_TEXTAREA",
			"mandatory": false,
			"editable": true,
			"description": "Multi line text field",
			"defaultValue": "testing lined\ntext"
		},
		{
			"id": "UDF0000003800",
			"classCode": "TASK",
			"displayLabel": "API-Lab-Numeric",
			"name": "api_lab_numeric_3800",
			"fieldType": "TYPE_NUMBER",
			"mandatory": false,
			"editable": true,
			"description": "Testing numeric case",
			"defaultValue": "10"
		}
	],
	"cc": "john.smith@gmail.com",
	"ticketArisedTime": "",
	"createdUser": {
		"id": "USR0000000018",
		"loginName": "superadmin",
		"lastName": "Admin",
		"firstName": "SP",
		"email": "sample@gmail.com"
	},
	"reason": "Close Task",
	"alertIds": [],
	"reOpenCount": 0,
	"createdDate": "2016-11-25T10:15:00+0000",
	"suspendEndDate": "2016-11-29T10:16:00+0000",
	"allowedStatus": [],
	"client": {
		"id": 8,
		"uniqueId": "client_8",
		"name": "Brocade Lab",
		"activated": true
	},
	"sourcePolicyType": "MANUAL",
	"updatedDate": "2016-11-25T10:18:49+0000",
	"priorityUpdatedBy": {
		"loginName": "john.smith",
		"lastName": "smith",
		"firstName": "john",
		"email": "john.smith@gmail.com",
		"phoneNumber": "998-559-1234"
	},
	"priorityUpdatedDate": "2016-11-25T10:15:00+0000",
	"statusUpdatedBy": {
		"loginName": "john.bolt",
		"lastName": "Bolt",
		"firstName": "Bolt",
		"email": "john.bolt@gmail.com"
	},
	"statusUpdatedDate": "2016-11-25T10:18:49+0000",
	"resolvedDate": "2016-11-25T10:16:15+0000",
	"closedDate": "2016-11-25T10:18:49+0000",
	"slaDetails": {
		"resolutionTime": 75,
		"responseTime": 75,
		"responseBreach": false,
		"resolutionBreach": false,
		"responseBreachDate": "",
		"resolutionBreachDate": ""
	},
	"source": "PORTAL",
	"statusFlow": [{
			"status": "New",
			"timeSpent": 49,
			"createdDate": "2016-11-25T10:15:00+0000",
			"updatedBy": {
				"id": "USR0000000018",
				"loginName": "superadmin",
				"lastName": "Admin",
				"firstName": "SP",
				"email": "sample@gmail.com"
			}
		},
		{
			"status": "Open",
			"timeSpent": 26,
			"reason": "Open task",
			"createdDate": "2016-11-25T10:15:49+0000",
			"updatedBy": {
				"id": "USR0000000018",
				"loginName": "superadmin",
				"lastName": "Admin",
				"firstName": "SP",
				"email": "sample@gmail.com"
			}
		},
		{
			"status": "Resolved",
			"timeSpent": 11,
			"reason": "Resolve Task",
			"notes": "Resolving task. Assuming completed",
			"createdDate": "2016-11-25T10:16:15+0000",
			"updatedBy": {
				"id": "USR0000000018",
				"loginName": "superadmin",
				"lastName": "Admin",
				"firstName": "SP",
				"email": "sample@gmail.com"
			}
		},
		{
			"status": "On Hold",
			"timeSpent": 143,
			"reason": "On Hold task",
			"notes": "Resolving task. Assuming completed",
			"createdDate": "2016-11-25T10:16:26+0000",
			"updatedBy": {
				"id": "USR0000000018",
				"loginName": "superadmin",
				"lastName": "Admin",
				"firstName": "SP",
				"email": "sample@gmail.com"
			}
		},
		{
			"status": "Closed",
			"reason": "Project Integration Completed",
			"notes": "Project structure integration shared with the admin team and architect team.",
			"createdDate": "2016-11-25T10:18:49+0000",
			"updatedBy": {
				"loginName": "john.bolt",
				"lastName": "Bolt",
				"firstName": "John",
				"email": "john.bolt@gmail.com"
			}
		}
	]
}