Create a policy
curl --request POST \
--url https://sla.thena.ai/v1/sla/policy \
--header 'Content-Type: application/json' \
--data '
{
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": true,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [
{
"label": "High Priority"
}
],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"teamId": "team-123456"
}
'import requests
url = "https://sla.thena.ai/v1/sla/policy"
payload = {
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [{ "label": "Open" }]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [{ "label": "High Priority" }, { "label": "Medium Priority" }]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": True,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [{ "label": "High Priority" }],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [{ "label": "Open" }]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [{ "label": "High Priority" }, { "label": "Medium Priority" }]
}
]
},
"teamId": "team-123456"
}
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({
name: 'High Priority Ticket SLA',
description: 'SLA policy for handling high priority tickets',
entityType: 'ticket',
filter: {
all: [
{
entity: 'ticket',
field: 'status',
operator: 'equals',
values: [{label: 'Open'}]
}
],
any: [
{
entity: 'ticket',
field: 'priority',
operator: 'in',
values: [{label: 'High Priority'}, {label: 'Medium Priority'}]
}
]
},
policyMetrics: [
{
metric: 'FIRST_RESPONSE_TIME',
default: true,
durationInMinutes: '120',
specific: [
{
entity: 'ticket',
field: 'priority',
operator: 'equals',
values: [{label: 'High Priority'}],
durationInMinutes: '60'
}
]
}
],
pauseConditions: {
all: [
{
entity: 'ticket',
field: 'status',
operator: 'equals',
values: [{label: 'Open'}]
}
],
any: [
{
entity: 'ticket',
field: 'priority',
operator: 'in',
values: [{label: 'High Priority'}, {label: 'Medium Priority'}]
}
]
},
teamId: 'team-123456'
})
};
fetch('https://sla.thena.ai/v1/sla/policy', 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://sla.thena.ai/v1/sla/policy",
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([
'name' => 'High Priority Ticket SLA',
'description' => 'SLA policy for handling high priority tickets',
'entityType' => 'ticket',
'filter' => [
'all' => [
[
'entity' => 'ticket',
'field' => 'status',
'operator' => 'equals',
'values' => [
[
'label' => 'Open'
]
]
]
],
'any' => [
[
'entity' => 'ticket',
'field' => 'priority',
'operator' => 'in',
'values' => [
[
'label' => 'High Priority'
],
[
'label' => 'Medium Priority'
]
]
]
]
],
'policyMetrics' => [
[
'metric' => 'FIRST_RESPONSE_TIME',
'default' => true,
'durationInMinutes' => '120',
'specific' => [
[
'entity' => 'ticket',
'field' => 'priority',
'operator' => 'equals',
'values' => [
[
'label' => 'High Priority'
]
],
'durationInMinutes' => '60'
]
]
]
],
'pauseConditions' => [
'all' => [
[
'entity' => 'ticket',
'field' => 'status',
'operator' => 'equals',
'values' => [
[
'label' => 'Open'
]
]
]
],
'any' => [
[
'entity' => 'ticket',
'field' => 'priority',
'operator' => 'in',
'values' => [
[
'label' => 'High Priority'
],
[
'label' => 'Medium Priority'
]
]
]
]
],
'teamId' => 'team-123456'
]),
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://sla.thena.ai/v1/sla/policy"
payload := strings.NewReader("{\n \"name\": \"High Priority Ticket SLA\",\n \"description\": \"SLA policy for handling high priority tickets\",\n \"entityType\": \"ticket\",\n \"filter\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"policyMetrics\": [\n {\n \"metric\": \"FIRST_RESPONSE_TIME\",\n \"default\": true,\n \"durationInMinutes\": \"120\",\n \"specific\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n }\n ],\n \"durationInMinutes\": \"60\"\n }\n ]\n }\n ],\n \"pauseConditions\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"teamId\": \"team-123456\"\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://sla.thena.ai/v1/sla/policy")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High Priority Ticket SLA\",\n \"description\": \"SLA policy for handling high priority tickets\",\n \"entityType\": \"ticket\",\n \"filter\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"policyMetrics\": [\n {\n \"metric\": \"FIRST_RESPONSE_TIME\",\n \"default\": true,\n \"durationInMinutes\": \"120\",\n \"specific\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n }\n ],\n \"durationInMinutes\": \"60\"\n }\n ]\n }\n ],\n \"pauseConditions\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"teamId\": \"team-123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sla.thena.ai/v1/sla/policy")
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 \"name\": \"High Priority Ticket SLA\",\n \"description\": \"SLA policy for handling high priority tickets\",\n \"entityType\": \"ticket\",\n \"filter\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"policyMetrics\": [\n {\n \"metric\": \"FIRST_RESPONSE_TIME\",\n \"default\": true,\n \"durationInMinutes\": \"120\",\n \"specific\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n }\n ],\n \"durationInMinutes\": \"60\"\n }\n ]\n }\n ],\n \"pauseConditions\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"teamId\": \"team-123456\"\n}"
response = http.request(request)
puts response.read_body{
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": true,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [
{
"label": "High Priority"
}
],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"teamId": "<string>",
"organizationId": "<string>",
"version": 123,
"priority": 123,
"isActive": true,
"uid": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}SLA Policies
Create a policy
POST
/
v1
/
sla
/
policy
Create a policy
curl --request POST \
--url https://sla.thena.ai/v1/sla/policy \
--header 'Content-Type: application/json' \
--data '
{
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": true,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [
{
"label": "High Priority"
}
],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"teamId": "team-123456"
}
'import requests
url = "https://sla.thena.ai/v1/sla/policy"
payload = {
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [{ "label": "Open" }]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [{ "label": "High Priority" }, { "label": "Medium Priority" }]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": True,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [{ "label": "High Priority" }],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [{ "label": "Open" }]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [{ "label": "High Priority" }, { "label": "Medium Priority" }]
}
]
},
"teamId": "team-123456"
}
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({
name: 'High Priority Ticket SLA',
description: 'SLA policy for handling high priority tickets',
entityType: 'ticket',
filter: {
all: [
{
entity: 'ticket',
field: 'status',
operator: 'equals',
values: [{label: 'Open'}]
}
],
any: [
{
entity: 'ticket',
field: 'priority',
operator: 'in',
values: [{label: 'High Priority'}, {label: 'Medium Priority'}]
}
]
},
policyMetrics: [
{
metric: 'FIRST_RESPONSE_TIME',
default: true,
durationInMinutes: '120',
specific: [
{
entity: 'ticket',
field: 'priority',
operator: 'equals',
values: [{label: 'High Priority'}],
durationInMinutes: '60'
}
]
}
],
pauseConditions: {
all: [
{
entity: 'ticket',
field: 'status',
operator: 'equals',
values: [{label: 'Open'}]
}
],
any: [
{
entity: 'ticket',
field: 'priority',
operator: 'in',
values: [{label: 'High Priority'}, {label: 'Medium Priority'}]
}
]
},
teamId: 'team-123456'
})
};
fetch('https://sla.thena.ai/v1/sla/policy', 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://sla.thena.ai/v1/sla/policy",
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([
'name' => 'High Priority Ticket SLA',
'description' => 'SLA policy for handling high priority tickets',
'entityType' => 'ticket',
'filter' => [
'all' => [
[
'entity' => 'ticket',
'field' => 'status',
'operator' => 'equals',
'values' => [
[
'label' => 'Open'
]
]
]
],
'any' => [
[
'entity' => 'ticket',
'field' => 'priority',
'operator' => 'in',
'values' => [
[
'label' => 'High Priority'
],
[
'label' => 'Medium Priority'
]
]
]
]
],
'policyMetrics' => [
[
'metric' => 'FIRST_RESPONSE_TIME',
'default' => true,
'durationInMinutes' => '120',
'specific' => [
[
'entity' => 'ticket',
'field' => 'priority',
'operator' => 'equals',
'values' => [
[
'label' => 'High Priority'
]
],
'durationInMinutes' => '60'
]
]
]
],
'pauseConditions' => [
'all' => [
[
'entity' => 'ticket',
'field' => 'status',
'operator' => 'equals',
'values' => [
[
'label' => 'Open'
]
]
]
],
'any' => [
[
'entity' => 'ticket',
'field' => 'priority',
'operator' => 'in',
'values' => [
[
'label' => 'High Priority'
],
[
'label' => 'Medium Priority'
]
]
]
]
],
'teamId' => 'team-123456'
]),
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://sla.thena.ai/v1/sla/policy"
payload := strings.NewReader("{\n \"name\": \"High Priority Ticket SLA\",\n \"description\": \"SLA policy for handling high priority tickets\",\n \"entityType\": \"ticket\",\n \"filter\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"policyMetrics\": [\n {\n \"metric\": \"FIRST_RESPONSE_TIME\",\n \"default\": true,\n \"durationInMinutes\": \"120\",\n \"specific\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n }\n ],\n \"durationInMinutes\": \"60\"\n }\n ]\n }\n ],\n \"pauseConditions\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"teamId\": \"team-123456\"\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://sla.thena.ai/v1/sla/policy")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High Priority Ticket SLA\",\n \"description\": \"SLA policy for handling high priority tickets\",\n \"entityType\": \"ticket\",\n \"filter\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"policyMetrics\": [\n {\n \"metric\": \"FIRST_RESPONSE_TIME\",\n \"default\": true,\n \"durationInMinutes\": \"120\",\n \"specific\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n }\n ],\n \"durationInMinutes\": \"60\"\n }\n ]\n }\n ],\n \"pauseConditions\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"teamId\": \"team-123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sla.thena.ai/v1/sla/policy")
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 \"name\": \"High Priority Ticket SLA\",\n \"description\": \"SLA policy for handling high priority tickets\",\n \"entityType\": \"ticket\",\n \"filter\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"policyMetrics\": [\n {\n \"metric\": \"FIRST_RESPONSE_TIME\",\n \"default\": true,\n \"durationInMinutes\": \"120\",\n \"specific\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n }\n ],\n \"durationInMinutes\": \"60\"\n }\n ]\n }\n ],\n \"pauseConditions\": {\n \"all\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"status\",\n \"operator\": \"equals\",\n \"values\": [\n {\n \"label\": \"Open\"\n }\n ]\n }\n ],\n \"any\": [\n {\n \"entity\": \"ticket\",\n \"field\": \"priority\",\n \"operator\": \"in\",\n \"values\": [\n {\n \"label\": \"High Priority\"\n },\n {\n \"label\": \"Medium Priority\"\n }\n ]\n }\n ]\n },\n \"teamId\": \"team-123456\"\n}"
response = http.request(request)
puts response.read_body{
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": true,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [
{
"label": "High Priority"
}
],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"teamId": "<string>",
"organizationId": "<string>",
"version": 123,
"priority": 123,
"isActive": true,
"uid": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Body
application/json
Response
Operation successful