Jump to content

Kevin Allitt

Hornbill Users
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Kevin Allitt's Achievements

Apprentice

Apprentice (3/14)

  • One Year In
  • Reacting Well
  • One Month Later
  • Collaborator
  • Dedicated Rare

Recent Badges

1

Reputation

  1. xmlmc_v_0.0.1.tar That is a break down of thats in that tar file, it all seams to be python 2 and I get complains for as you can see this errors with python 3 and not python 2, does anyone know where I get the python 3 libryary from as https://github.com/hornbill/pythonApiLib does not seem to be the python 3 libruary. Kind Regards Kevin
  2. Hi, yes you are correct, I found this out eventually by playing and now I have just noticed your comment, I can confirm to anyone who is reading this that what James Ainsworth has just said, is correct, its like there is a session that expires on the webpage that isnt re-initialised until you go to the root of the website and traverse the link a refresh. Thank you for replying James, much appreciated.
  3. Find incidents, click on update. https://api.hornbill.com/apps/com.hornbill.servicemanager https://api.hornbill.com/apps/Incidents?op=update There are many more pages like this that just dont go anywhere
  4. 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.
  5. 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
  6. 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
  7. # 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.
  8. 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.
  9. 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.
  10. 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
  11. Tried it The Steve G's way, Downloaded https://github.com/hornbill/pythonApiLib Copied the exception.py and the xmlmc.py into the current code folder, you can put it in the python pathed modules folder as well. I wrote the code below, called it all.py and ran python all.py and this created a ticket, outputted the ticket number and then updated it and then closed the ticket. So if anyone out there is stuck and struggling to work this out, this works and should work for you without having to fall down all the rabbit holes I did, and learnt a whole new set of things that are not related, if your question is how do you do it and can you have an example, then your answer is below. Remember to place your own API key and instance name in the places pointed out by X's #!/usr/bin/env python2 from xmlmc import XmlmcService from xmlmc import XmlmcHelper import sys import subprocess # # Initiate XmlmcService instance # xmlmc = XmlmcService("XXXX Your Instance Name XXXX") # # With API key (Recommended) # xmlmc.set_api_key("XXXXXX YourKey XXXXXX") # Get session info # Create The Ticket xmlmc.add_param("summary", "Test ScienceLogic summary Test") xmlmc.add_param("description", "Test ScineceLogic Test") xmlmc.add_param("requestType", "Incident") # you can change this to what ever type you have xmlmc.add_param("serviceId", "15") # you need to put your own serviceid in here xmlmc.add_param("catalogId", "39") # you need to put your own catalogid in here 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") print(requestId) else: print(XmlmcHelper.get_error_message(json_string)) # Now Update xmlmc.add_param("requestId", requestId) xmlmc.add_param("h_summary", "hornbill summary from SOMEWHERE has been updated") xmlmc.add_param("h_description", "Some Desc i have also been updated") json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/Requests", "update") # Now Close The Ticket xmlmc.add_param("requestId", requestId) xmlmc.add_param("closeText", "This Ticket had to go") json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/Requests", "closeRequest")
  12. So Now we have access to the Database, how do you go about in SQL :- Creating a New Ticket Finding out what the New Ticket Number Is Updating that ticket Closing that ticket. Thank you for the above help on the API and gaining access we are nearly there in concept.
  13. curl -v -X POST -H "Content-type: text/xmlmc;charset=utf-8" -H "Authorization: ESP-APIKEY $KEY" --data-binary @/home/kevinal/xml.xml https://mdh-p01-api.hornbill.com/pasm/xmlmc/data/ 2> /dev/null <?xml version="1.0" encoding="utf-8" ?> <methodCallResult status="ok"> <params> <rowsAffected>0</rowsAffected> <lastInsertId>0</lastInsertId> <rowData> <row> <h_pk_reference>SR00101217</h_pk_reference> <h_activity_stream_id>urn:buzz:activityStream:bd9052c7-2866-4a7b-b2a9-62de00694ba2</h_activity_stream_id> <h_archived>0</h_archived> <h_locked_details>0</h_locked_details> <h_bpm_authorised>0</h_bpm_authorised> <h_bpm_id>BPM20220120000024</h_bpm_id> <h_bpm_stage_expired>0</h_bpm_stage_expired> <h_catalog>Raise a Service Request</h_catalog> <h_catalog_id>259</h_catalog_id> <h_category>Service Request-&gt;Customer Support-&gt;Entertainment Data-&gt;TV Other</h_category> <h_category_id>425</h_category_id> <h_closedby_team_id>PressAssociation/ITOps1/</h_closedby_team_id> <h_closedby_teamname>SysOps Support</h_closedby_teamname> <h_closedby_user_id>josephe</h_closedby_user_id> <h_closedby_username>XXXX</h_closedby_username> <h_closure_category>Resolved with Technical Intervention-&gt;Service Request Delivered or Closed</h_closure_category> <h_closure_category_id>221</h_closure_category_id> <h_container_id>0</h_container_id> <h_createdby>XXX</h_createdby> <h_custom_l>2</h_custom_l> <h_customer_type>0</h_customer_type> <h_dateclosed>2022-01-20 15:24:17</h_dateclosed> <h_datelastmodified>2022-01-20 15:24:18</h_datelastmodified> <h_datelogged>2022-01-20 10:02:44</h_datelogged> <h_dateresolved>2022-01-20 15:24:16</h_dateresolved> <h_description>XXX has asked if someone generate a XXX</h_description> <h_feedback_status>not required</h_feedback_status> <h_feedback_status_id>5</h_feedback_status_id> <h_fk_priorityid>5</h_fk_priorityid> <h_fk_priorityname>Priority 2</h_fk_priorityname> <h_fk_serviceid>25</h_fk_serviceid> <h_fk_servicename>XXXData</h_fk_servicename> <h_fk_servicelevelagreementid>7</h_fk_servicelevelagreementid> <h_fk_servicelevelagreementname>XXX XXX Core Hours</h_fk_servicelevelagreementname> <h_fk_servicelevelid>0</h_fk_servicelevelid> <h_fk_team_id>XXX/ITOps1/</h_fk_team_id> <h_fk_team_name>XXXSupport</h_fk_team_name> <h_fk_user_id>XXX</h_fk_user_id> <h_fk_user_name>XXX XXX</h_fk_user_name> <h_idx_ref>XXX</h_idx_ref> <h_isanalystunread>0</h_isanalystunread> <h_ownerid>josephe</h_ownerid> <h_ownername>XXX XXX</h_ownername> <h_reopencount>0</h_reopencount> <h_request_language>en-GB</h_request_language> <h_request_prefix>SR</h_request_prefix> <h_requesttype>Service Request</h_requesttype> <h_resolution>XXX </h_resolution> <h_resolvedby_team_id>XXX/ITOps1/</h_resolvedby_team_id> <h_resolvedby_teamname>XXXSupport</h_resolvedby_teamname> <h_resolvedby_user_id>XXX</h_resolvedby_user_id> <h_resolvedby_username>XXX XXX</h_resolvedby_username> <h_site>XXX Ops</h_site> <h_site_id>29</h_site_id> <h_social_object_ref>urn:sys:entity:com.hornbill.servicemanager:Requests:XXX</h_social_object_ref> <h_social_object_urn>urn:sys:user:nickyl</h_social_object_urn> <h_source_id>1225339</h_source_id> <h_source_type>Email</h_source_type> <h_status>status.closed</h_status> <h_summary>Digiguide XX/XX Refresh</h_summary> <h_org_id>0</h_org_id> <h_last_update_activity_id>urn:buzz:activity:cbe5015e-db84-4674-9add-fb7a5e377910</h_last_update_activity_id> <h_lastmodifieduserid>XXX</h_lastmodifieduserid> <h_lastmodifiedusername>XXX XX</h_lastmodifiedusername> <h_lastmodifiedusertype>0</h_lastmodifiedusertype> <h_lastmodifiedtype>0</h_lastmodifiedtype> </row> </rowData> <queryExecTime>2738</queryExecTime> <queryResultsTime>992</queryResultsTime> </params> </methodCallResult> cat xml.xml <methodCall service="data" method="sqlQuery"> <params> <query>select * from h_itsm_requests where h_pk_reference = 'SR00101217'</query> </params> </methodCall>
  14. Logs (EspApiTransaction) ? 18111826/01/2022 15:28:43error17644 0.036985s [ERROR]:[DATABASE] The maximum number of rows allowed (25000) has been exceeded, query aborted 0.037519s [ERROR]:[PROFILE] data::sqlQuery() Method call results: failure (242262016 B, 35 ms, -20 kB, 0 ms, 0 kB) So this looks promising as it shows the API is receiving a query and its an SQL issue. What would be a really good query to send for testing ? I basically dont know anything about its database. Is there a doc showing its database Layout, I guess I should be able to Insert, Delete and Update tables with this method. Are there any restraint rules and triggers that populate tables when others are added to etc. If I want to create a ticket, what would the Query be and on which tables ?
×
×
  • Create New...