-
Hello,
I have not been able to assign a license to an application when creating a software assignment category. I have detected that title-based assignment is not supported and id-based assignment returns an error.
My attempt in i-doit demo:
{ "version": "2.0", "method": "cmdb.category.save", "params": { "object": 1412, "category": "C__CATG__APPLICATION", "data": { "application": 477, "assigned_version": 22, "assigned_license": 2988 }, "apikey": "c1ia5q", "language": "en" }, "id": 1 }
{ "id": 1, "jsonrpc": "2.0", "error": { "code": -32603, "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_catg_application_list__isys_cats_lic_list__id`) REFERENCES `isys_cats_lic_)", "data": { "mysqlErrorCode": 1452, "mysqlErrorMessage": "Database error : Query error: 'INSERT INTO isys_catg_application_list SET\n\t\t\tisys_catg_application_list__isys_connection__id = 5180,\n\t\t\tisys_catg_application_list__isys_obj__id = 1412,\n\t\t\tisys_catg_application_list__description = '',\n\t\t\tisys_catg_application_list__status = 2,\n\t\t\tisys_catg_application_list__isys_cats_app_variant_list__id = NULL,\n\t\t\tisys_catg_application_list__isys_cats_lic_list__id = 2988,\n\t\t\tisys_catg_application_list__bequest_nagios_services = 0,\n\t\t\tisys_catg_application_list__isys_catg_application_type__id = 1,\n\t\t\tisys_catg_application_list__isys_catg_application_priority__id = NULL,\n\t\t\tisys_catg_application_list__isys_catg_version_list__id = 22;':\nCannot add or update a child row: a foreign key constraint fails (`idoit_demo_data_pro`.`isys_catg_application_list`, CONSTRAINT `isys_catg_application_list_ibfk_7` FOREIGN KEY (`isys_catg_application_list__isys_cats_lic_list__id`) REFERENCES `isys_cats_lic_)\n" } } }
The same query works fine when "assigned_license" is removed. This license assignment can be done on the web without issues.
-
-
Hello @philipp-hörselmann,
I am using i-doit Version 1.16 OPEN with API add-on version 1.12.1.
I have also tested this on https://demo.i-doit.com/ with the same result.
Best regards
-
Hi @fa__ ,
it looks like you are using the object ID of the license object for "assigend_license" right?
You need to use the ID of the license entry itself. F.e.: After creating a license object you fill out the specific category license. The IDs of the documented license keys have to be used to assign the license.At first you need to read out the category license list of the license object. You will find the needed IDs there.
Example:{ "version": "2.0", "method": "cmdb.category.read", "params": { "objID": 2988, "category": "C__CATS__LICENCE_LIST", "apikey": "c1ia5q", "language": "en" }, "id": 1 }
The result willshow you the entries of the specific category with the IDs of the licences. These IDs you need to use.
Best
Phil -
Yes, I was using the ID of the license object.
It works fine with the license entry ID.Thank you!