Skip to main content
POST
/
api
/
v2
/
workspaces
/
{workspaceId}
/
tickets
/
link
Link ticket
curl --request POST \
  --url https://api.example.com/api/v2/workspaces/{workspaceId}/tickets/link \
  --header 'Content-Type: application/json' \
  --data '
{
  "ticketId": "<string>",
  "incident": {
    "id": "<string>",
    "workspaceId": "<string>",
    "number": "<string>"
  }
}
'
import requests

url = "https://api.example.com/api/v2/workspaces/{workspaceId}/tickets/link"

payload = {
"ticketId": "<string>",
"incident": {
"id": "<string>",
"workspaceId": "<string>",
"number": "<string>"
}
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ticketId: '<string>',
incident: {id: '<string>', workspaceId: '<string>', number: '<string>'}
})
};

fetch('https://api.example.com/api/v2/workspaces/{workspaceId}/tickets/link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/workspaces/{workspaceId}/tickets/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ticketId' => '<string>',
'incident' => [
'id' => '<string>',
'workspaceId' => '<string>',
'number' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/api/v2/workspaces/{workspaceId}/tickets/link"

payload := strings.NewReader("{\n \"ticketId\": \"<string>\",\n \"incident\": {\n \"id\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"number\": \"<string>\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/api/v2/workspaces/{workspaceId}/tickets/link")
.header("Content-Type", "application/json")
.body("{\n \"ticketId\": \"<string>\",\n \"incident\": {\n \"id\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"number\": \"<string>\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v2/workspaces/{workspaceId}/tickets/link")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticketId\": \"<string>\",\n \"incident\": {\n \"id\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"number\": \"<string>\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "autotaskTicket": {
      "id": 123,
      "companyId": 123,
      "projectId": 123,
      "assignedResourceId": 123,
      "assignedResourceRoleId": 123,
      "billingCodeId": 123,
      "categoryId": 123,
      "number": "<string>",
      "type": 123,
      "title": "<string>",
      "description": "<string>",
      "status": 123,
      "queueId": 123,
      "dueDateTime": "2023-11-07T05:31:56Z",
      "notes": [
        {
          "id": 123,
          "description": "<string>",
          "ticketId": 123,
          "title": "<string>"
        }
      ]
    },
    "serviceNowTicket": {
      "id": "<string>",
      "description": "<string>",
      "shortDescription": "<string>",
      "number": "<string>",
      "comments": [
        {
          "sysId": "<string>",
          "elementId": "<string>",
          "value": "<string>",
          "createdOn": "2023-11-07T05:31:56Z",
          "createdBy": "<string>",
          "element": "<string>"
        }
      ]
    },
    "jiraTicket": {
      "id": "<string>",
      "description": "<string>",
      "summary": "<string>",
      "number": "<string>",
      "currentStatus": {
        "id": "<string>",
        "name": "<string>"
      },
      "priority": {
        "id": "<string>",
        "name": "<string>"
      },
      "assignee": {
        "accountId": "<string>",
        "displayName": "<string>",
        "active": true
      },
      "project": {
        "id": "<string>",
        "name": "<string>",
        "key": "<string>"
      },
      "issueType": {
        "id": "<string>",
        "name": "<string>",
        "projectId": "<string>",
        "subtask": true
      },
      "requestType": {
        "id": "<string>",
        "name": "<string>"
      },
      "labels": [
        "<string>"
      ],
      "availablePriorities": [
        {
          "id": "<string>",
          "name": "<string>"
        }
      ],
      "availableStatuses": [
        {
          "id": "<string>",
          "name": "<string>"
        }
      ]
    },
    "isTicketSet": true
  },
  "meta": {
    "requestId": "<string>",
    "timestamp": "<string>"
  }
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"target": "<string>",
"errors": {}
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"target": "<string>",
"errors": {}
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"target": "<string>",
"errors": {}
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"target": "<string>",
"errors": {}
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"target": "<string>",
"errors": {}
}

Path Parameters

workspaceId
string<uuid>
required

Body

application/json
ticketId
null | string
incident
object

Response

OK

Standard v2 API response envelope for single-item responses.

data
object
meta
object