Kevin Allitt Posted March 16, 2022 Share Posted March 16, 2022 I am using Python, Below is how I pass my params into it xmlmc.add_param("summary", "Test ScienceLogic summary Test")xmlmc.add_param("description", "Test ScineceLogic Test")xmlmc.add_param("requestType", "Incident")xmlmc.add_param("serviceId", "15")xmlmc.add_param("catalogId", "39") json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/Requests", "logRequest")if XmlmcHelper.is_call_success(json_string): requestId = XmlmcHelper.get_param_value(json_string, "params/requestId") This Works Fine When I move from testing to something with a more meaningful header like below I get an error. xmlmc.add_param("summary", "Test ScienceLogic summary Test")xmlmc.add_param("description", "Test ScineceLogic Test")xmlmc.add_param("customerId", "servicedesk")xmlmc.add_param("teamId", "PressAssociation/ITOps1/")xmlmc.add_param("status", "open")xmlmc.add_param("priorityId", "6")xmlmc.add_param("serviceId", "1") The Error is as follows FlowCode Exception (com.hornbill.servicemanager/entities/Requests/fc_ops/logRequest): Input parameter validation error: The element was not expected at location '/methodCall/params/customerId Can anyone tell me why, is that not a valid parameter "customerId", am I forming it incorrectly. can anyone help please Link to comment Share on other sites More sharing options...
Graham Posted March 16, 2022 Share Posted March 16, 2022 Hi @Kevin Allitt You need to include the requestType parameter between the description and customerId parameters. The requestType is a required parameter and so cannot be omitted. See https://api.hornbill.com/apps/com.hornbill.servicemanager/Requests?op=logRequest Graham 1 Link to comment Share on other sites More sharing options...
Kevin Allitt Posted March 16, 2022 Author Share Posted March 16, 2022 I placed in the requestType, I can create tickets but they are not populating owner customer fields xmlmc.add_param("summary", "Test ScienceLogic summary Test")xmlmc.add_param("description", "Test ScineceLogic Test")xmlmc.add_param("requestType", "Incident")xmlmc.add_param("customerId", "servicedesk")xmlmc.add_param("teamId", "PressAssociation/ITOps1/")xmlmc.add_param("status", "open")xmlmc.add_param("priorityId", "6")xmlmc.add_param("serviceId", "1")xmlmc.add_param("bpmName", "PA Monitoring incident") How do you include the bpnName, so the ticket gets processed proberly. Link to comment Share on other sites More sharing options...
Kevin Allitt Posted March 16, 2022 Author Share Posted March 16, 2022 Also the customerId which is service desk is not passing through the Customer on the ticket and this isnt happening, do you have any ideas why that is and is it related to the bpnName. Thanks in advance. Link to comment Share on other sites More sharing options...
Guest Ehsan Posted March 16, 2022 Share Posted March 16, 2022 @Kevin Allitt, The customerType parameter should be included when the customerId parameter is set. In your example, the user 'servicedesk' is a co-worker, so the customerType parameter should be set to 0. Is the team that you have supplied supporting the service? This can be checked through the service definition via main menu > Service Manager > Services Portfolio. To include the BPM name, you should use the request type API instead of logRequest. For example, to raise an Incident, you should use https://api.hornbill.com/apps/com.hornbill.servicemanager/Incidents?op=logIncident. I hope this helps. Ehsan Link to comment Share on other sites More sharing options...
Kevin Allitt Posted March 17, 2022 Author Share Posted March 17, 2022 # Get session info xmlmc.add_param("summary", "Test ScienceLogic summary Test") xmlmc.add_param("description", "Test ScineceLogic Test") xmlmc.add_param("requestType", "Incident") xmlmc.add_param("customerId", "servicedesk") xmlmc.add_param("customerType", 0) xmlmc.add_param("ownerId", "6") xmlmc.add_param("teamId", "PressAssociation/ITOps1/") xmlmc.add_param("status", "open") xmlmc.add_param("priorityId", "6") xmlmc.add_param("serviceId", "1") xmlmc.add_param("bpmName", "PA Monitoring incident") #xmlmc.add_param("summary", "Test ScienceLogic summary Test") #xmlmc.add_param("description", "Test ScineceLogic Test") #xmlmc.add_param("requestType", "Incident") #xmlmc.add_param("serviceId", "15") #xmlmc.add_param("catalogId", "39") json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/Incidents", "logIncident") if XmlmcHelper.is_call_success(json_string): requestId = XmlmcHelper.get_param_value(json_string, "params/requestId") print(requestId) else: print(XmlmcHelper.get_error_message(json_string)) results with error python create-ticket3.py FlowCode Exception (com.hornbill.servicemanager/entities/Incidents/fc_ops/logIncident): nodeName: Invoke Flowcode: logRequest; nodeId: 8b0730bb-35ac-4401-a122-0c4fc41cd55e; At 377/1: "Uncaught EspMethodCall::invoke: Operation[apps/com.hornbill.servicemanager/Requests::logRequest] /apps/com.hornbill.servicemanager/entities/Requests/fc_modules/requests_helper.js(5948): error X1001: Uncaught TypeError: Cannot read property 'firstName' of null" throw(e); _fc_node_exec_8b0730bb_35ac_4401_a122_0c4fc41cd55e Any Idea's. Link to comment Share on other sites More sharing options...
Steve Giller Posted March 17, 2022 Share Posted March 17, 2022 Does the "servicedesk" customer exist, and if so does it have a firstName populated? Link to comment Share on other sites More sharing options...
Kevin Allitt Posted March 17, 2022 Author Share Posted March 17, 2022 It Exists I'm not sure of the firstName does or where to look for that at the minute, would that state that it does with it saying Service Desk ? I'll Check see if I can access a hornbill admin in the morning to see if it has a value. Someone also said that the bpnName path can also be acquired by using the below from the requests which made the above ticked in testing, for which case I would not need the Incidents. catalogId xs:string optional This parameter can be set with the Id of the Request's catalog. This option should only be supplied if 'serviceId' parameter is set. catalogName Link to comment Share on other sites More sharing options...
Kevin Allitt Posted March 18, 2022 Author Share Posted March 18, 2022 I can confirm that the firstName is set to Service lastName is Desk already for the customer id of servicedesk Link to comment Share on other sites More sharing options...
Kevin Allitt Posted March 18, 2022 Author Share Posted March 18, 2022 first name and last name are defined. any Ideas further to the error. # Get session info xmlmc.add_param("summary", "Test ScienceLogic summary Test") xmlmc.add_param("description", "Test ScineceLogic Test") xmlmc.add_param("requestType", "Incident") xmlmc.add_param("customerId", "servicedesk") xmlmc.add_param("customerType", 0) xmlmc.add_param("ownerId", "6") xmlmc.add_param("teamId", "PressAssociation/ITOps1/") xmlmc.add_param("status", "open") xmlmc.add_param("priorityId", "6") xmlmc.add_param("serviceId", "1") xmlmc.add_param("bpmName", "PA Monitoring incident") #xmlmc.add_param("summary", "Test ScienceLogic summary Test") #xmlmc.add_param("description", "Test ScineceLogic Test") #xmlmc.add_param("requestType", "Incident") #xmlmc.add_param("serviceId", "15") #xmlmc.add_param("catalogId", "39") json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/Incidents", "logIncident") if XmlmcHelper.is_call_success(json_string): requestId = XmlmcHelper.get_param_value(json_string, "params/requestId") print(requestId) else: print(XmlmcHelper.get_error_message(json_string)) kevinal@DV00393:~$ python create-ticket3.py FlowCode Exception (com.hornbill.servicemanager/entities/Incidents/fc_ops/logIncident): nodeName: Invoke Flowcode: logRequest; nodeId: 8b0730bb-35ac-4401-a122-0c4fc41cd55e; At 377/1: "Uncaught EspMethodCall::invoke: Operation[apps/com.hornbill.servicemanager/Requests::logRequest] /apps/com.hornbill.servicemanager/entities/Requests/fc_modules/requests_helper.js(5948): error X1001: Uncaught TypeError: Cannot read property 'firstName' of null" throw(e); _fc_node_exec_8b0730bb_35ac_4401_a122_0c4fc41cd55e Link to comment Share on other sites More sharing options...
Kevin Allitt Posted March 22, 2022 Author Share Posted March 22, 2022 xmlmc.add_param("summary", "Test ScienceLogic summary Test") xmlmc.add_param("description", "Test ScineceLogic Test") xmlmc.add_param("serviceId", "25") xmlmc.add_param("catalogId", "369") json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/Incidents", "logIncident") if XmlmcHelper.is_call_success(json_string): requestId = XmlmcHelper.get_param_value(json_string, "params/requestId") print(requestId) else: print(XmlmcHelper.get_error_message(json_string)) The Answer is get the serviceid and catalogid to match correctly and have a default business process method Name and it will pickup the default business process method, we didnt have a default business process Method Name defined. If this helps anyone out there who gets stuck on trying to make there python created hornbill ticket go down a bpmName for externally created tickets. Link to comment Share on other sites More sharing options...
Josh.F Posted August 15, 2023 Share Posted August 15, 2023 I'm getting a similar issue but I'm getting the data from within our instance, its being pulled from a data query in the Intelligent capture, but within the business process I'm using it to add connections, it was working only the other day, yet for some reason it's no longer working. the same information is being written to the Summary and description and is having no issue, but when trying to add the customer as a connection to the request it's just failing. <error>/apps/com.hornbill.servicemanager/entities/RequestConnections/fc_modules/request_connections_helper.js(598): error X1001: Uncaught TypeError: Cannot read property 'h_first_name' of undefined</error> just as an example to the error that I'm getting that lead me here, any help would be appreciated. Link to comment Share on other sites More sharing options...
Steve Giller Posted August 15, 2023 Share Posted August 15, 2023 "Cannot read property ... of undefined" is means what it's trying to look at does not exist - not the value (h_first_name) but the entity itself. Without being able to see this could be anything, but from the mentions of Connections and h_first_name I'll assume a Contact/User and say the User you're providing doesn't exist - this could be passing a Handle instead of an ID, passing information relevant to a User (Co-Worker) where it expects it for a Contact. e.g. Putting a Co-Worker's User ID (a String value) in the Contact (From Variable) parameter will break, as will putting a Contact's ID (an Integer value) in the Co-Worker (From Variable) parameter. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now