Objekt
DANGER
Das Anpassen von Objekten über API kann zu ernsthaften Problemen mit Ihrer Instanz führen. Gehen Sie mit absoluter Vorsicht vor und stellen Sie sicher, dass Sie keine Standardfelder von Zammad anpassen.
Wenn Sie Felder ausblenden möchten, sollten Sie stattdessen die Core-Workflows von Zammad verwenden!
Auflisten
Erforderliche Berechtigung: admin.object
GET
-Anfrage gesendet: /api/v1/object_manager_attributes
Show response
// HTTP-Code 200 OK
[
{
"id": 2,
"name": "customer_id",
"display": "Customer",
"data_type": "user_autocompletion",
"data_option": {
"relation": "User",
"autocapitalize": false,
"multiple": false,
"guess": true,
"null": false,
"limit": 200,
"placeholder": "Enter Person or Organization/Company",
"minLengt": 2,
"translate": false,
"permission": [
"ticket.agent"
]
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"create_top": {
"-all-": {
"null": false
}
},
"edit": {}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 10,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.677Z",
"updated_at": "2021-11-09T13:12:32.677Z",
"object": "Ticket",
"deletable": false,
"not_deletable_reason": "This attribute is referenced by Overview: My Tickets and thus cannot be deleted!"
},
{
"id": 1,
"name": "title",
"display": "Title",
"data_type": "input",
"data_option": {
"type": "text",
"maxlength": 200,
"null": false,
"translate": false
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"create_top": {
"-all-": {
"null": false
}
},
"edit": {}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 15,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.671Z",
"updated_at": "2021-11-09T13:12:32.671Z",
"object": "Ticket",
"deletable": false
},
{
"id": 3,
"name": "type",
"display": "Type",
"data_type": "select",
"data_option": {
"default": "",
"options": {
"Incident": "Incident",
"Problem": "Problem",
"Request for Change": "Request for Change"
},
"nulloption": true,
"multiple": false,
"null": true,
"translate": true,
"maxlength": 255
},
"data_option_new": {},
"editable": true,
"active": false,
"screens": {
"create_middle": {
"-all-": {
"null": false,
"item_class": "column"
}
},
"edit": {
"ticket.agent": {
"null": false
}
}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 20,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.686Z",
"updated_at": "2021-11-09T13:12:32.686Z",
"object": "Ticket",
"deletable": true
},
{
"id": 4,
"name": "group_id",
"display": "Group",
"data_type": "select",
"data_option": {
"default": "",
"relation": "Group",
"relation_condition": {
"access": "full"
},
"nulloption": true,
"multiple": false,
"null": false,
"translate": false,
"only_shown_if_selectable": true,
"permission": [
"ticket.agent",
"ticket.customer"
],
"maxlength": 255
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"create_middle": {
"-all-": {
"null": false,
"item_class": "column"
}
},
"edit": {
"ticket.agent": {
"null": false
}
}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 25,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.690Z",
"updated_at": "2021-11-09T13:12:32.690Z",
"object": "Ticket",
"deletable": false
},
{
"id": 5,
"name": "owner_id",
"display": "Owner",
"data_type": "select",
"data_option": {
"default": "",
"relation": "User",
"relation_condition": {
"roles": "Agent"
},
"nulloption": true,
"multiple": false,
"null": true,
"translate": false,
"permission": [
"ticket.agent"
],
"maxlength": 255
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"create_middle": {
"-all-": {
"null": true,
"item_class": "column"
}
},
"edit": {
"-all-": {
"null": true
}
}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 30,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.694Z",
"updated_at": "2021-11-09T13:12:32.694Z",
"object": "Ticket",
"deletable": false,
"not_deletable_reason": "This attribute is referenced by Trigger: customer notification (on owner change); Overview: My assigned Tickets,My pending reached Tickets,Unassigned & Open and thus cannot be deleted!"
},
{
"id": 6,
"name": "state_id",
"display": "State",
"data_type": "select",
"data_option": {
"relation": "TicketState",
"nulloption": true,
"multiple": false,
"null": false,
"default": 2,
"translate": true,
"filter": [
2,
1,
3,
4,
6,
7
],
"maxlength": 255
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"create_middle": {
"ticket.agent": {
"null": false,
"item_class": "column",
"filter": [
2,
1,
3,
4,
7
]
},
"ticket.customer": {
"item_class": "column",
"nulloption": false,
"null": true,
"filter": [
1,
4
],
"default": 1
}
},
"edit": {
"ticket.agent": {
"nulloption": false,
"null": false,
"filter": [
2,
3,
4,
7
]
},
"ticket.customer": {
"nulloption": false,
"null": true,
"filter": [
2,
4
],
"default": 2
}
}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 40,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.706Z",
"updated_at": "2021-11-09T13:12:32.706Z",
"object": "Ticket",
"deletable": false,
"not_deletable_reason": "This attribute is referenced by Trigger: auto reply (on new tickets); Overview: My Organization Tickets,My Tickets,My assigned Tickets,My pending reached Tickets,My replacement Tickets,Open,Open Banana Items,Pending reached,Unassigned & Open,VIP Customers and thus cannot be deleted!"
},
{
"id": 7,
"name": "pending_time",
"display": "Pending till",
"data_type": "datetime",
"data_option": {
"future": true,
"past": false,
"diff": 24,
"null": true,
"translate": true,
"permission": [
"ticket.agent"
]
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"create_middle": {
"-all-": {
"null": false,
"item_class": "column"
}
},
"edit": {
"-all-": {
"null": false
}
}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 41,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.713Z",
"updated_at": "2021-11-09T13:12:32.713Z",
"object": "Ticket",
"deletable": false,
"not_deletable_reason": "This attribute is referenced by Overview: My pending reached Tickets,Pending reached and thus cannot be deleted!"
},
{
"id": 8,
"name": "priority_id",
"display": "Priority",
"data_type": "select",
"data_option": {
"relation": "TicketPriority",
"nulloption": false,
"multiple": false,
"null": false,
"default": 2,
"translate": true,
"maxlength": 255
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"create_middle": {
"ticket.agent": {
"null": false,
"item_class": "column"
}
},
"edit": {
"ticket.agent": {
"null": false
}
}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 80,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.718Z",
"updated_at": "2021-11-09T13:12:32.718Z",
"object": "Ticket",
"deletable": false
}
]
Anzeigen
Erforderliche Berechtigung: admin.object
GET
-Anfrage gesendet: /api/v1/object_manager_attributes/{id}
Show response
// HTTP-Code 200 OK
{
"id": 18,
"object_lookup_id": 1,
"name": "email",
"display": "Email",
"data_type": "input",
"data_option": {
"type": "email",
"maxlength": 150,
"null": true,
"item_class": "formGroup--halfSize"
},
"data_option_new": {},
"editable": false,
"active": true,
"screens": {
"signup": {
"-all-": {
"null": false
}
},
"invite_agent": {
"-all-": {
"null": false
}
},
"invite_customer": {
"-all-": {
"null": false
}
},
"edit": {
"-all-": {
"null": true
}
},
"create": {
"-all-": {
"null": true
}
},
"view": {
"-all-": {
"shown": true
}
}
},
"to_create": false,
"to_migrate": false,
"to_delete": false,
"to_config": false,
"position": 400,
"created_by_id": 1,
"updated_by_id": 1,
"created_at": "2021-11-09T13:12:32.784Z",
"updated_at": "2021-11-09T13:12:32.784Z"
}
Erstellen
Erforderliche Berechtigung: admin.object
POST
-Anfrage gesendet: /api/v1/object_manager_attributes
Boolean
Show request/response
{
"name": "sample_boolean",
"object": "Ticket",
"display": "Sample Boolean",
"active": true,
"position": 1550,
"data_type": "boolean",
"data_option": {
"options": {
"true": "very correct indeed",
"false": "very incorrect indeed"
}
},
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
Datum
Show request/response
{
"name": "sample_date",
"object": "Ticket",
"display": "Sample Date",
"active": true,
"position": 1550,
"data_type": "date",
"data_option": {
"diff": 120
},
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
Datum & Zeit
Show request/response
{
"name": "sample_datetime",
"object": "Ticket",
"display": "Sample DateTime",
"active": true,
"position": 1550,
"data_type": "datetime",
"data_option": {
"future": true,
"past": false,
"diff": 120
},
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
Integer
Show request/response
{
"name": "sample_integer",
"object": "Ticket",
"display": "Sample Integer",
"active": true,
"position": 1550,
"data_type": "integer",
"data_option": {
"default": 1234,
"min": 4,
"max": 8
},
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
Einfachauswahl
Show request/response
{
"name": "sample_select",
"object": "Ticket",
"display": "Sample Select",
"active": true,
"position": 1550,
"data_type": "select",
"data_option": {
"options": {
"key-one": "First Key",
"key-two": "Second Key",
"key-three": "Third Key"
},
"default": "key-two",
"linktemplate": ""
},
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
Text
Show request/response
{
"name": "sample_text",
"object": "Ticket",
"display": "Sample Text",
"active": true,
"position": 1550,
"data_type": "input",
"data_option": {
"default": "amazing default",
"type": "text",
"maxlength": 120,
"linktemplate": "https://www.google.com/search?q=#{ticket.sample_text}"
},
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
TIP
Zammad-Eingabefelder können 4 verschiedene Typen haben:
E-Mail
Tel
Text
Url
(unterstützt keine Link-Templates)
Je nach gewähltem Eingabetyp erwartet Zammad unterschiedliche Formate von Daten. Z.B.: verlangt E-Mail die Angabe einer E-Mail-Adresse.
Einfach-Baumauswahl
Show request/response
{
"name": "sample_treeselect",
"object": "Ticket",
"display": "Sample Tree Select",
"active": true,
"position": 1550,
"data_type": "tree_select",
"data_option": {
"options": [
{
"name": "row one - maximum child depth",
"value": "row one - maximum child depth",
"children": [
{
"name": "row one child level one",
"value": "row one - maximum child depth::row one child level one",
"children": [
{
"name": "row one child level two",
"value": "row one - maximum child depth::row one child level one::row one child level two",
"children": [
{
"name": "row one child level three",
"value": "row one - maximum child depth::row one child level one::row one child level two::row one child level three",
"children": [
{
"name": "row one child level four",
"value": "row one - maximum child depth::row one child level one::row one child level two::row one child level three::row one child level four",
"children": [
{
"name": "row one child level fize",
"value": "row one - maximum child depth::row one child level one::row one child level two::row one child level three::row one child level four::row one child level fize"
}
]
}
]
}
]
}
]
}
]
},
{
"name": "row two - no childs",
"value": "row two - no childs"
},
{
"name": "row three - one child",
"value": "row three - one child",
"children": [
{
"name": "row three - first and only child",
"value": "row three - one child::row three - first and only child"
}
]
}
]
},
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
INFO
Bitte beachten Sie, dass sich die oben genannten Payloads auf Ticket-Objekte beziehen. Dies ist in den meisten Situationen in Ordnung, außer wenn es um die Standardobjekt-Berechtigungen geht. Deshalb führen wir diese hier separat auf.
Das Attribut object
steuert, welcher Kontext verwendet wird:
Ticket
User
Organisation
Group
.
{
"screens": {
"create_middle": {
"ticket.customer": {
"shown": true,
"required": false,
"item_class": "column"
},
"ticket.agent": {
"shown": true,
"required": false,
"item_class": "column"
}
},
"edit": {
"ticket.customer": {
"shown": true,
"required": false
},
"ticket.agent": {
"shown": true,
"required": true
}
}
}
}
Aktualisierung
Erforderliche Berechtigung: admin.object
Abgesehen von der Request-Methode sind die Payloads zum Aktualisieren und Erstellen von Objekten identisch. Für vollständige Payload-Beispiele scrollen Sie also bis zu create_object
.
Zammad gibt während der Aktualisierung zwei Attribute zurück: data_option
und data_option_new
. Das erste Attribut enthält die aktuellen aktiven Werte und das zweite die neuen Werte (sie werden nach der Ausführung der Datenbankmigrationen aktiv).
PUT
-Anfrage gesendet: /api/v1/object_manager_attributes/{id}
Show request/response
{
"id": 50,
"name": "sample_boolean",
"object": "Ticket",
"display": "Sample Boolean",
"data_type": "boolean",
"position": 1200,
"data_option": {
"options": {
"true": "yes",
"false": "no"
},
"default": "false"
}
}
INFO
Stellen Sie sicher, dass Sie data_option
angeben. Zammad ist sehr wählerisch, wenn Sie dieses Attribut weglassen. Bitte beachten Sie, dass eine Änderung des Objekttyps nach der Erstellung nicht mehr möglich ist.
Löschen
Erforderliche Berechtigung: admin.object
DELETE
-Anfrage gesendet: /api/v1/object_manager_attributes/{id}
Show response
// HTTP-Code 200 OK
{}
Ausführen von Datenbank-Migrationen
Erforderliche Berechtigung: admin.object
WARNING
Nach der Durchführung von Datenbankmigrationen ist ein Neustart von Zammad zwingend erforderlich. Wenn nicht per Auto-Shutdown-Einstellung, deaktiviert, startet Zammad automatisch neu - rechnen Sie mit einer kurzen Ausfallzeit.
POST
-Anfrage gesendet: /api/v1/object_manager_attributes_execute_migrations
Show response
// HTTP-Code 200 OK
{}