Update Assignment Rule
Replace an assignment rule’s conditions and actions, and optionally set its display_order. Omitting display_order leaves it unchanged. Excluded from the generated MCP tools: Catalyst changes assignment rules through staged, human-published change sets, and an auto-generated tool would be an unstaged second path to the same rows.
curl --request PUT \
--url https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conditions": [
{
"conditions": [
{
"requesterCustomField": {
"fieldKey": "<string>",
"values": [
"<string>"
]
}
}
]
}
],
"actions": [
{
"assignedEntityId": "<string>"
}
],
"displayOrder": 123
}
'import requests
url = "https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}"
payload = {
"conditions": [{ "conditions": [{ "requesterCustomField": {
"fieldKey": "<string>",
"values": ["<string>"]
} }] }],
"actions": [{ "assignedEntityId": "<string>" }],
"displayOrder": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conditions: [
{
conditions: [{requesterCustomField: {fieldKey: '<string>', values: ['<string>']}}]
}
],
actions: [{assignedEntityId: '<string>'}],
displayOrder: 123
})
};
fetch('https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}', 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://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'conditions' => [
[
'conditions' => [
[
'requesterCustomField' => [
'fieldKey' => '<string>',
'values' => [
'<string>'
]
]
]
]
]
],
'actions' => [
[
'assignedEntityId' => '<string>'
]
],
'displayOrder' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}"
payload := strings.NewReader("{\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"requesterCustomField\": {\n \"fieldKey\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"assignedEntityId\": \"<string>\"\n }\n ],\n \"displayOrder\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"requesterCustomField\": {\n \"fieldKey\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"assignedEntityId\": \"<string>\"\n }\n ],\n \"displayOrder\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"requesterCustomField\": {\n \"fieldKey\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"assignedEntityId\": \"<string>\"\n }\n ],\n \"displayOrder\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"conditions": [
{
"conditions": [
{
"requesterCustomField": {
"fieldKey": "<string>",
"operator": "RULE_CONDITION_OPERATOR_UNSPECIFIED",
"values": [
"<string>"
]
}
}
]
}
],
"actions": [
{
"assignedEntityId": "<string>",
"assignedEntityType": "ASSIGNED_ENTITY_TYPE_UNSPECIFIED"
}
],
"displayOrder": 123,
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Whole-rule replace, not a patch. A PATCH could not distinguish "leave the conditions alone" from "clear them" without a field mask, and clearing them silently is the dangerous direction: a rule with no conditions matches every ticket. display_order is the exception and is genuinely optional, because it has a meaningful "leave it where it is".
Replaced wholesale. Empty clears the rule's conditions, which makes it match every ticket.
Show child attributes
Show child attributes
At least one is required.
Show child attributes
Show child attributes
Absent leaves the rule where it sorts.
Response
Success
Show child attributes
Show child attributes
Was this page helpful?
curl --request PUT \
--url https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conditions": [
{
"conditions": [
{
"requesterCustomField": {
"fieldKey": "<string>",
"values": [
"<string>"
]
}
}
]
}
],
"actions": [
{
"assignedEntityId": "<string>"
}
],
"displayOrder": 123
}
'import requests
url = "https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}"
payload = {
"conditions": [{ "conditions": [{ "requesterCustomField": {
"fieldKey": "<string>",
"values": ["<string>"]
} }] }],
"actions": [{ "assignedEntityId": "<string>" }],
"displayOrder": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conditions: [
{
conditions: [{requesterCustomField: {fieldKey: '<string>', values: ['<string>']}}]
}
],
actions: [{assignedEntityId: '<string>'}],
displayOrder: 123
})
};
fetch('https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}', 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://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'conditions' => [
[
'conditions' => [
[
'requesterCustomField' => [
'fieldKey' => '<string>',
'values' => [
'<string>'
]
]
]
]
]
],
'actions' => [
[
'assignedEntityId' => '<string>'
]
],
'displayOrder' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}"
payload := strings.NewReader("{\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"requesterCustomField\": {\n \"fieldKey\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"assignedEntityId\": \"<string>\"\n }\n ],\n \"displayOrder\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"requesterCustomField\": {\n \"fieldKey\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"assignedEntityId\": \"<string>\"\n }\n ],\n \"displayOrder\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/teams/{team_id}/assignment-rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"requesterCustomField\": {\n \"fieldKey\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"assignedEntityId\": \"<string>\"\n }\n ],\n \"displayOrder\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"conditions": [
{
"conditions": [
{
"requesterCustomField": {
"fieldKey": "<string>",
"operator": "RULE_CONDITION_OPERATOR_UNSPECIFIED",
"values": [
"<string>"
]
}
}
]
}
],
"actions": [
{
"assignedEntityId": "<string>",
"assignedEntityType": "ASSIGNED_ENTITY_TYPE_UNSPECIFIED"
}
],
"displayOrder": 123,
"createdAt": "2025-01-15T01:30:15.000Z",
"updatedAt": "2025-01-15T01:30:15.000Z"
}
}
