Documentation is now available for the Fall 2020 Update release!

Create task

This endpoint is used to create a task.

Leave Feedback

URL

POST https://{api-url}/api/v2/tenants/{tenantId}/tasks

Sample URLs

https://{api-url}/api/v2/tenants/client_7/tasks

Parameters

FieldData TypeDescription
subjectStringSubject of the request.
descriptionStringDescription of the request.
priorityStringPriority of the request.
estimatedHoursIntegerEstimated time for completion of the task.

Note: Provide time in minutes format. If the estimated time is 1 hour, use the value of 60 (minutes).

startDateString(Optional) Date from which the assigned user would work on the task.
endDateString(Optional) Date for completion of the task.
ccString(Optional) Cc email.
assignedUserString(Optional) User responsible for working on the task.
requesterString(Optional) Requester or Submitter of the request.
resourcesString(Optional) Resources for which the task is created.
customFieldsString(Optional) User-defined, custom fields are used to provide additional information of the task. To retrieve the list of customized fields, use the Get custom fields API.
attachmentsObject(Optional) Attach files related to the task. Limit on attachment file size is 50 MB. Convert attachment files should always be converted to a byte stream with base64 encoding.
locationString(Optional) Resource location.
extTicketIdString(Optional) Attach external ticket ID with the request.
tagsString(Optional) Labels for the purpose of identification.
projectInteger(Optional)
knowledgeArticleIdsInteger(Optional) Attach knowledge base articles to a Task. Below are instructions to retrieve a knowledge base article by its ID:
  1. Log into OpsRamp.
  2. Click Knowledge Base.
  3. Select the required article and then copy the article ID.
  4. Provide the article ID in knowledgeArticleIds field.
    Example: "knowledgeArticleIds": 23, 65

Sample request

{
	"subject": "Update Python Version",
	"description": "Need to upgrade the applications and infrastructure",
	"priority": "Normal",
	"estimatedHours": "4",
	"startDate": "2016-04-01T06:43:00+0000",
	"endDate": "2016-04-10T07:43:00+0000",
	"cc": "john.smith@myorganization.com,james.blake@myorganization.com",
	"location": "location@123",
	"extTicketId": "000042526342",
	"tags": "API,Tasks",
	"project": {
		"id": "3"
	},
	"requester": {
		"id": "USR0000002146",
		"loginName": "John.Smith"
	},
	"assignedUser": {
		"id": "USR0000002146",
		"loginName": "John.Smith"
	},
	"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": "1"
		},
		{
			"id": "UDF0000003798",
			"name": "api_lab_text_3798",
			"value": "testing text field"
		},
		{
			"id": "UDF0000003801",
			"name": "api_lab_checkbox_3801",
			"value": "1"
		},
		{
			"id": "UDF0000003802",
			"name": "api_lab_date_3802",
			"value": "2016-03-28T10:10:00+0000"
		}
	],
	"attachments": [{
			"name": "2.txt",
			"file": "U2FtcGxlIFRleHQgZmlsZS0gdGVzdGluZyB3aXRoIGF0dGFjaG1lbnQ="
		},
		{
			"name": "1.txt",
			"file": "U2FtcGxlIFRleHQgZmlsZS0gdGVzdGluZyB3aXRoIGF0dGFjaG1lbnQ="
		}
	],
	"knowledgeArticleIds": [
		28, 17
	]
}

Sample response

{
	"id": "TASK0000001109",
	"subject": "Update Python Version",
	"description": "Need to upgrade applications and infrastructure",
	"status": "New",
	"oldStatus": "New",
	"priority": "Normal",
	"oldPriority": "Low",
	"requester": {
		"id": "USR0000002146",
		"loginName": "John.Smith",
		"lastName": "Smith",
		"firstName": "John",
		"email": "john.smith@myorganization.com"
	},
	"assignedUser": {
		"id": "USR0000002146",
		"loginName": "John.Smith",
		"lastName": "Smith",
		"firstName": "John",
		"email": "john.smith@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": "1",
			"selectedOption": {
				"label": "first",
				"value": "1"
			}
		},
		{
			"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"
		},
		{
			"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"
			}],
			"value": "1",
			"selectedOption": {
				"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-28T15: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": "andrew@myorganization.com,james@myorganization.com",
	"ticketArisedTime": "",
	"createdUser": {
		"id": "USR0000002095",
		"loginName": "Annie.Marie",
		"lastName": "Marie",
		"firstName": "Annie",
		"email": "annie.marie@myorganization.com"
	},
	"alertIds": [],
	"createdDate": "2016-03-29T08:24:30+0000",
	"allowedStatus": [{
			"id": "2",
			"name": "Open",
			"reasonsEnabled": true,
			"reasonsDefined": true
		},
		{
			"id": "3",
			"name": "Pending",
			"reasonsEnabled": true,
			"reasonsDefined": true
		},
		{
			"id": "4",
			"name": "Resolved",
			"reasonsEnabled": true,
			"reasonsDefined": true
		},
		{
			"id": "5",
			"name": "Closed",
			"reasonsEnabled": true,
			"reasonsDefined": true
		},
		{
			"id": "6",
			"name": "On Hold",
			"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:24:32+0000",
	"priorityUpdatedBy": {
		"id": "USR0000002146",
		"loginName": "John.Smith",
		"lastName": "Smith",
		"firstName": "John",
		"email": "john.smith@myorganzation.com"
	},
	"priorityUpdatedDate": "2016-03-29T08:24:30+0000",
	"statusUpdatedBy": {
		"id": "USR0000002146",
		"loginName": "John.Smith",
		"lastName": "Smith",
		"firstName": "John",
		"email": "john.smith@myorganzation.com"
	},
	"statusUpdatedDate": "2016-03-29T08:24:30+0000",
	"slaDetails": {
		"resolutionTime": 0,
		"responseTime": 0,
		"responseBreach": false,
		"resolutionBreach": false,
		"responseBreachDate": "",
		"resolutionBreachDate": ""
	},
	"source": "INTEGRATION",
	"startDate": "2016-04-01T12:13:00+0000",
	"endDate": "2016-04-10T13:13:00+0000",
	"estimatedHours": 4,
	"timeSpent": 0,
	"project": {
		"id": 3,
		"name": "Sample Integration"
	},
	"statusFlow": [{
		"status": "New",
		"createdDate": "2016-07-25T12:42:19+0000",
		"updatedBy": {
			"loginName": "System.User",
			"lastName": "system",
			"firstName": "user",
			"email": "systemuser@myorganization.com"
		}
	}],
	"knowledgeArticleIds": [
		28, 17
	],
	"attachedArticles": [{
			"id": 28,
			"subject": "Update Python on Ubuntu"
		},
		{
			"id": 17,
			"subject": "Frequently Asked Questions on Python"
		}
	]
}