Die bei uns eingesetzte Version ist 1.11.2
Latest posts made by OliverGnapp
-
RE: API: Keine Rückgabewerte bei den SLA-Zeiten
-
API: Keine Rückgabewerte bei den SLA-Zeiten
Hallo,
wir speichern zu unseren Services die SLA's wie hier im Beispiel:
In der Datenbank finden sich die Werte wieder:
isys_catg_sla_list__id, 56
isys_catg_sla_list__isys_obj__id, 5434
isys_catg_sla_list__service_id, 5x12
isys_catg_sla_list__service_level, 0
isys_catg_sla_list__isys_sla_service_level__id, NULL
isys_catg_sla_list__days, 1111100
isys_catg_sla_list__monday_time, {"from":25200 "to":68400}
isys_catg_sla_list__tuesday_time, {"from":25200 "to":68400}
isys_catg_sla_list__wednesday_time, {"from":25200 "to":68400}
isys_catg_sla_list__thursday_time, {"from":25200 "to":68400}
isys_catg_sla_list__friday_time, {"from":25200 "to":68400}
isys_catg_sla_list__saturday_time, NULL
isys_catg_sla_list__sunday_time, NULL
isys_catg_sla_list__reaction_time, 1
isys_catg_sla_list__reaction_time_unit, 3
isys_catg_sla_list__recovery_time, 1
isys_catg_sla_list__recovery_time_unit, 3
isys_catg_sla_list__description, NULL
isys_catg_sla_list__status, 2Über die API lassen sich diese Werte aber nicht auslesen:
[
{
"description": null,
"sunday_time": null,
"saturday_time": null,
"calendar": null,
"reaction_time": "1",
"id": "56",
"days": "1111100",
"wednesday_time": "00:00 - 00:00",
"tuesday_time": "00:00 - 00:00",
"service_level": null,
"recovery_time_unit": {
"const": "C__CMDB__UNIT_OF_TIME__HOUR",
"title": "Hours",
"id": "3",
"title_lang": "LC__CMDB__UNIT_OF_TIME__HOUR"
},
"service_id": "5x12",
"monday_time": "00:00 - 00:00",
"thursday_time": "00:00 - 00:00",
"recovery_time": "1",
"objID": "5434",
"service_level_dialog": null,
"reaction_time_unit": {
"const": "C__CMDB__UNIT_OF_TIME__HOUR",
"title": "Hours",
"id": "3",
"title_lang": "LC__CMDB__UNIT_OF_TIME__HOUR"
},
"friday_time": "00:00 - 00:00"
}
]Wie bekomme ich die Zeiten angezeigt?
Grüße
Oliver -
RE: Zuweisung einer Person zu einer Personengruppe per API funktioniert nicht
Danke für den Link.
Die Lösung ( api.validation = 0 in den Expert Settings ) hat geholfen. -
Zuweisung einer Person zu einer Personengruppe per API funktioniert nicht
Hallo,
in der Category "Person group memberships" ist dokumentiert, dass das Feld "Person group memberships" vom Typ Integer[] ist.
Quelle: Administration - Interfaces - external data - JSON-RPC API - Categories and attributes - Category : Person group membership C__CATS__PERSON_ASSIGNED_GROUPS)
Verwende ich im Aufruf ein Integer-Array, erscheint ein Datenbankfehler:
Aufruf:
curl -k -u "very:secret" -H "Content-Type: application/json" -X POST -d "{ "objid" : 29, "category" : "C__CATS__PERSON_ASSIGNED_GROUPS", "data" : { "connected_object" : [ 35 ], "contact" : 29 } }" http://localhost:4321/latest/category
{
"id": 0,
"success": false,
"message": "Internal error: An database error occurred that indicates that you provided an Id which does not exist. \n Please check all properties which are referencing an entry for validity: FOREIGN KEY (isys_person_2_group__isys_obj__id__group
) REFERENCESisys_obj
(isys_obj__id
) ON DELETE CASCADE ON)"
}Auszug aus dem API-Log:
[2019-02-25 10:02:05 588697] DEBUG: Calculated model parameters based on method "cmdb.category.save"":
[
"category",
{
"object": 29,
"category": "C__CATS__PERSON_ASSIGNED_GROUPS",
"data": {
"contact": 29,
"connected_object": [
35
]
},
"objID": 29,
"apikey": "xmreky8lf404k0oo",
"language": "en",
"option": "save"
}
]
[2019-02-25 10:02:05 588812] DEBUG: Prepare to run request...
[2019-02-25 10:02:05 590261] INFO: Method: save
[2019-02-25 10:02:05 600389] ERROR: An exception occured while processing request: -32603 Internal error: An database error occurred that indicates that you provided an Id which does not exist.
Please check all properties which are referencing an entry for validity: FOREIGN KEY (isys_person_2_group__isys_obj__id__group
) REFERENCESisys_obj
(i sys_obj__id
) ON DELETE CASCADE ON)
{
"mysqlErrorCode": 1452,
"mysqlErrorMessage": "Database error : Query error: 'INSERT INTO isys_person_2_group SET isys_person_2_group__isys_obj__id__person = '29', isys_person_2_group__isys_obj__id__group = 'Array';':\nCannot add or update a child row: a foreign key constraint fails (idoit_data
.isys_person_2_group
, CONSTRAINTisys_person_2_group_ibfk_2
FOREIGN KEY (isys_person_2_group__isys_obj__id__group
) REFERENCESisys_obj
(isys_obj__id
) ON DELETE CASCADE ON)\n"
}Verwende ich im Aufruf anstatt einem Integer-Arrays nur den Integer-Wert, erscheint in der Ausgabe ein Formatfehler:
Aufruf:
curl -k -u "very:secret" -H "Content-Type: application/json" -X POST -d "{ "objid" : 29, "category" : "C__CATS__PERSON_ASSIGNED_GROUPS", "data" : { "connected_object" : 35 , "contact" : 29 } }" http://localhost:4321/latest/category
{
"id": 0,
"success": false,
"message": "Internal error: There was an validation error"
}Auszug aus dem API-Log:
[2019-02-25 10:03:12 281845] DEBUG: Calculated model parameters based on method "cmdb.category.save"":
[
"category",
{
"object": 29,
"category": "C__CATS__PERSON_ASSIGNED_GROUPS",
"data": {
"contact": 29,
"connected_object": 35
},
"objID": 29,
"apikey": "xmreky8lf404k0oo",
"language": "en",
"option": "save"
}
]
[2019-02-25 10:03:12 281962] DEBUG: Prepare to run request...
[2019-02-25 10:03:12 283243] INFO: Method: save
[2019-02-25 10:03:12 288691] ERROR: An exception occured while processing request: -32603 Internal error: There was an validation error
{
"connected_object": "(object_browser) Property has to be an array."
}Object 29 ist die Person und Object 35 ist die Personengruppe.
Wie muss ein korrekter Aufruf aussehen?
Was ist bei der Verknüpfung von Personen, Personengrupppen und Organisationen zu beachten?Grüße
Oliver