URL
POST https://{api-url}/api/v2/tenants/{tenantId}/tasks/{taskId}
Sample URLs
https://{api-url}/api/v2/tenants/client_7/tasks/TASK0000001109
Parameters
All parameters are optional:
Field | Data Type | Description |
---|---|---|
priority | String | Priority of the request. |
startDate | String | Date from which the assigned user would work on the task. |
endDate | String | Date for completion of the task. |
cc | String | Email addresses of users who need to copied in the email notification. |
assignedUser | String | User responsible for working on the task. |
requester | String | User who requests a task. |
resources | String | Resources for which the task is created. |
customFields | String | User defined fields to include additional information of the task. Note: Create custom field in OpsRamp and to fetch the list of the customized fields use Get custom fields. |
response | String | Relevant information of the ticket can be included in response. Example: file attachments, external ID, tags |
status | String | Status of Task.
Prerequisite: Check for the status workflow defined for the entity.
|
reason | Reason to change status of Task. Only the reasons predefined by a partner or client can be added. To retrieve the list of reasons defined for entity Task, use the Get status change reasons API. | |
suspendEndDate | On-hold date. This field is mandatory only if the option - Make On Hold date as mandatory when status moves to On Hold is enabled in Service Desk settings. | |
notes | Additional information related to Task. | |
knowledgeArticleIds | Attach knowledge base articles to a Task. Below are instructions to retrieve the knowledge base article ID:
|
Date format is yyyy-MM-ddTHH:mm:ssZ (GMT).
Sample request
{
"status": "On Hold",
"reason": "Reason to on hold Task",
"notes": "Ticket status update",
"suspendEndDate": "2016-04-10T06:43:00+0000",
"priority": "High",
"startDate": "2016-04-01T06:43:00+0000",
"endDate": "2016-04-25T07:43:00+0000",
"cc": "john.smith@opsramp.com",
"requester": {
"id": "USR0000002147",
"loginName": "FSSL-API-Lab-User-2"
},
"assignedUser": {
"id": "USR0000002147",
"loginName": "FSSL-API-Lab-User-2"
},
"resources": [{
"id": "481af404-33a6-4d61-af77-c483ca6641fa"
}, {
"id": "SGP-7adf3762-f310-4c14-9ecd-443eb7c6c208"
}, {
"id": "DGP-8d44a504-fd4b-4a78-ba34-2dfdf3ffb85e"
}],
"customFields": [{
"id": "UDF0000003797",
"name": "api_lab_drop_down_3797",
"value": "2"
},
{
"id": "UDF0000003798",
"name": "api_lab_text_3798",
"value": "testing text field-update"
},
{
"id": "UDF0000003801",
"name": "api_lab_checkbox_3801",
"value": "0"
},
{
"id": "UDF0000003802",
"name": "api_lab_date_3802",
"value": "2016-03-30T10:10:00+0000"
}
],
"response": {
"description": "Add Response to Task with attachments",
"internal": "false",
"creator": {
"id": "USR0000002146",
"loginName": "John.Smith"
},
"tags": "API, TASK",
"attachments": [{
"name": "2.txt",
"file": "U2FtcGxlIFRleHQgZmlsZS0gdGVzdGluZyB3aXRoIGF0dGFjaG1lbnQ="
},
{
"name": "1.txt",
"file": "U2FtcGxlIFRleHQgZmlsZS0gdGVzdGluZyB3aXRoIGF0dGFjaG1lbnQ="
}
]
},
"knowledgeArticleIds": [
28, 17
]
}
Sample response
{
"id": "TASK0000001109",
"subject": "Upgrade Python Version",
"description": "Need to upgrade applications and infrastructure",
"status": "On Hold",
"oldStatus": "New",
"priority": "High",
"oldPriority": "Normal",
"requester": {
"id": "USR0000002147",
"loginName": "FSSL-API-Lab-User-2",
"lastName": "API-Lab-2",
"firstName": "FSSL",
"email": "amy.hudson@myorganization.com"
},
"assignedUser": {
"id": "USR0000001257",
"loginName": "James.Rivers",
"lastName": "Rivers",
"firstName": "James",
"email": "james.rivers@myorganization.com"
},
"resources": [{
"id": "481af404-33a6-4d61-af77-c483ca6641fa",
"name": "VTHLPT1000",
"type": "DEVICE"
},
{
"id": "SGP-7adf3762-f310-4c14-9ecd-443eb7c6c208",
"name": "VTH-SERVICES",
"type": "SERVICE"
},
{
"id": "DGP-8d44a504-fd4b-4a78-ba34-2dfdf3ffb85e",
"name": "VTH-ADMIN-DEVS",
"type": "DEVICE_GROUP"
}
],
"extTicketId": "000042526342",
"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",
"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"
},
{
"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"
},
{
"id": "UDF0000003800",
"classCode": "TASK",
"displayLabel": "API-Lab-Numeric",
"name": "api_lab_numeric_3800",
"fieldType": "TYPE_NUMBER",
"mandatory": false,
"editable": true,
"description": "Testing numeric case"
},
{
"id": "UDF0000003801",
"classCode": "TASK",
"displayLabel": "API-Lab-Checkbox",
"name": "api_lab_checkbox_3801",
"fieldType": "TYPE_CHECKBOX",
"mandatory": false,
"editable": true,
"description": "testing check box",
"options": [{
"label": "yes",
"value": "1"
}]
},
{
"id": "UDF0000003802",
"classCode": "TASK",
"displayLabel": "API-Lab-Date",
"name": "api_lab_date_3802",
"fieldType": "TYPE_DATE",
"mandatory": false,
"editable": true,
"description": "Date Field test",
"value": "2016-03-30T15:40:00+0000"
},
{
"id": "UDF0000003803",
"classCode": "TASK",
"displayLabel": "API-Lab-Date-Time",
"name": "api_lab_date_time_3803",
"fieldType": "TYPE_DATETIME",
"mandatory": false,
"editable": true,
"description": "Date and time test case"
}
],
"cc": "james@myorganization.com",
"ticketArisedTime": "",
"createdUser": {
"id": "USR0000002095",
"loginName": "John.Smith",
"lastName": "Smith",
"firstName": "John",
"email": "john.smith@myorganization.com"
},
"reason": "Reason to On Hold Task",
"alertIds": [],
"createdDate": "2016-03-29T08:24:30+0000",
"suspendEndDate": "2016-04-10T12:13:00+0000",
"allowedStatus": [{
"id": "1",
"name": "New",
"reasonsEnabled": false,
"reasonsDefined": false
},
{
"id": "3",
"name": "Pending",
"reasonsEnabled": true,
"reasonsDefined": true
},
{
"id": "5",
"name": "Closed",
"reasonsEnabled": true,
"reasonsDefined": true
}
],
"client": {
"id": 7,
"uniqueId": "client_7",
"name": "API Lab",
"activated": true,
"updatedTime": "",
"createdTime": "2012-10-09T11:49:34+0000"
},
"updatedDate": "2016-03-29T08:43:20+0000",
"priorityUpdatedBy": {
"id": "USR0000002095",
"loginName": "John.Smith",
"lastName": "Smith",
"firstName": "John",
"email": "john.smith@myorganization.com"
},
"priorityUpdatedDate": "2016-03-29T08:43:20+0000",
"statusUpdatedBy": {
"id": "USR0000002095",
"loginName": "John.Smith",
"lastName": "Smith",
"firstName": "John",
"email": "john.smith@myorganization.com"
},
"statusUpdatedDate": "2016-03-29T08:43:20+0000",
"slaDetails": {
"resolutionTime": 0,
"responseTime": 1130,
"responseBreach": false,
"resolutionBreach": false,
"responseBreachDate": "",
"resolutionBreachDate": ""
},
"source": "INTEGRATION",
"startDate": "2016-04-01T12:13:00+0000",
"endDate": "2016-04-25T13:13:00+0000",
"estimatedHours": 4,
"timeSpent": 200,
"project": {
"id": 3,
"name": "Sample Integration"
},
"statusFlow": [{
"status": "New",
"timeSpent": 1492634,
"createdDate": "2016-07-25T12:42:19+0000",
"updatedBy": {
"loginName": "John.Smith",
"lastName": "Smith",
"firstName": "John",
"email": "john.smith@myorganization.com"
}
},
{
"status": "On Hold",
"reason": "Required information is not available, making as on hold",
"createdDate": "2016-11-22T10:04:44+0000",
"updatedBy": {
"id": "USR0000000018",
"loginName": "Annie",
"lastName": "",
"firstName": "Annie",
"email": "annie.halls@myorganization.com"
}
}
],
"knowledgeArticleIds": [
28, 17
],
"attachedArticles": [{
"id": 28,
"subject": "Update Python on Ubuntu"
},
{
"id": 17,
"subject": "Frequently Asked Questions on Python"
}
]
}