Jump to content

FlowCode Exception (com.hornbill.servicemanager/entities/Requests/fc_ops/logRequest): Input parameter validation error: The element was not expected at location


Recommended Posts

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

I placed in the requestType, I can create tickets but they are not populating 

owner

customer 

 

fields

image.thumb.png.f877b10c7386bed10347268bbdf102c9.png

 

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

Guest Ehsan

@Kevin Allitt,

image.png

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.

image.png

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

# 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

image.thumb.png.69dc9a1c182bc08a3d25b14ba6037a5f.png

 

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

image.png.0ba84ed4a18fb1f44030c26c4a7b66a9.png

image.thumb.png.6fdbd9826fc893fb6ac298092ce90df0.png

 

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

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

  • 1 year later...

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 &apos;h_first_name&apos; 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

"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.

image.png

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...