Berto2002 Posted February 10, 2023 Share Posted February 10, 2023 Morning, We are starting to use the API Scheduler. It seems to work but the Request gets logged without a Customer, despite us using what we think is the correct customerId. We even match the case (have tried lower and CamelCase). We use email address as the ID in all cases: Both the desired Customer (james) and the admin ID are Subscribers to the Service under which this is being created. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Victor Posted February 13, 2023 Share Posted February 13, 2023 @Berto2002 can you post the full payload? EDIT: obv, obfuscate any personal/sensitive data Link to comment Share on other sites More sharing options...
JamesGreen Posted February 15, 2023 Share Posted February 15, 2023 { "APIKey": "key", "InstanceID": "instance", "Schedule": [{ "Enabled": true, "CronSchedule": "0 2 10 10 * 0-6", "DayOfMonthANDDayOfWeek":false, "ScheduleFrom": "2023-02-09T00:00:00.000Z", "ScheduleTo": "2030-02-09T00:00:00.000Z", "Service": "apps/com.hornbill.servicemanager/ServiceRequests", "API": "logServiceRequest", "APIParams":{ "0": { "Type":"Content", "Parameter":"summary", "Content":"ACTION TITLE" }, "1": { "Type":"Content", "Parameter":"description", "Content":"ACTION THIS" }, "2": { "Type":"Content", "Parameter":"RequestType", "Content":"Service Request" }, "3": { "Type":"Content", "Parameter":"customerId", "Content":"email@address" }, "4": { "Type":"Content", "Parameter":"teamId", "Content":"ICT_Infrastructure" }, "5": { "Type":"Content", "Parameter":"serviceId", "Content":"133" }, "6": { "Type":"Content", "Parameter":"catalogId", "Content":"1089" }, "7": { "Type":"Content", "Parameter":"catalogName", "Content":"API: Infrastructure Scheduled Requests" }, "8": { "Type":"Content", "Parameter":"bpmName", "Content":"sbc-infrastructure-alert-emails" } } }, { "Enabled": false, "CronSchedule": "0 2 10 10 * 0-6", "DayOfMonthANDDayOfWeek":false, "ScheduleFrom": "2023-02-09T00:00:00.000Z", "ScheduleTo": "2030-02-09T00:00:00.000Z", "Service": "apps/com.hornbill.servicemanager/ServiceRequests", "API": "logServiceRequest", "APIParams":{ "0": { "Type":"Content", "Parameter":"summary", "Content":"ACTION" }, "1": { "Type":"Content", "Parameter":"description", "Content":"ACTION" }, "2": { "Type":"Content", "Parameter":"RequestType", "Content":"Service Request" }, "3": { "Type":"Content", "Parameter":"customerId", "Content":"email@address" }, "4": { "Type":"Content", "Parameter":"teamId", "Content":"ICT_Infrastructure" }, "5": { "Type":"Content", "Parameter":"serviceId", "Content":"133" }, "6": { "Type":"Content", "Parameter":"catalogId", "Content":"1089" }, "7": { "Type":"Content", "Parameter":"catalogName", "Content":"API: Infrastructure Scheduled Requests" }, "8": { "Type":"Content", "Parameter":"bpmName", "Content":"sbc-infrastructure-alert-emails" } } } ] } Link to comment Share on other sites More sharing options...
Steve Giller Posted February 15, 2023 Share Posted February 15, 2023 @JamesGreen I've wrapped that in "Code" tags to make it easier to read. 1 Link to comment Share on other sites More sharing options...
Berto2002 Posted March 3, 2023 Author Share Posted March 3, 2023 @JamesGreen do you have your answer on this or need help still? Link to comment Share on other sites More sharing options...
Berto2002 Posted June 9, 2023 Author Share Posted June 9, 2023 @Steve Giller . We removed the bpmName and the BPM that was assigned was the one set as the workflow in the Service Request Configuration for that Service. The user we used is a subscriber to that Service (via being in a group) but the Customer still did not stick. Can you help us further? API stuff below. Also, can you please clarify a previous statement: "The bpmName parameter is described as The custom BPM Name when raising a request via a customised Service Catalog where your API appears to be using an actual Catalog Item". What is a customised Service Catalog and how would I use that so I can specify the bpmName? "Schedule": [{ "Enabled": true, "CronSchedule": "0 41 10 * * 0-6", "DayOfMonthANDDayOfWeek":false, "ScheduleFrom": "2023-06-06T00:00:00.000Z", "ScheduleTo": "2030-06-09T00:00:00.000Z", "Service": "apps/com.hornbill.servicemanager/ServiceRequests", "API": "logServiceRequest", "APIParams":{ "0": { "Type":"Content", "Parameter":"summary", "Content":"SENDIAS AA Teams Stats" }, "1": { "Type":"Content", "Parameter":"description", "Content":"SENDIAS AA Teams Stats to REDACTED. Run the Power BI Desktop AA application" }, "2": { "Type":"Content", "Parameter":"RequestType", "Content":"Service Request" }, "3": { "Type":"Content", "Parameter":"customerId", "Content":"REDACTED" }, "4": { "Type":"Content", "Parameter":"teamId", "Content":"ICT_Infrastructure" }, "5": { "Type":"Content", "Parameter":"serviceId", "Content":"133" }, "6": { "Type":"Content", "Parameter":"catalogId", "Content":"1089" }, "7": { "Type":"Content", "Parameter":"catalogName", "Content":"API: Infrastructure Scheduled Requests" } } }, { "Enabled": true, "CronSchedule": "0 41 10 * * 0-6", "DayOfMonthANDDayOfWeek":false, "ScheduleFrom": "2023-02-09T00:00:00.000Z", "ScheduleTo": "2030-02-09T00:00:00.000Z", "Service": "apps/com.hornbill.servicemanager/ServiceRequests", "API": "logServiceRequest", "APIParams":{ "0": { "Type":"Content", "Parameter":"summary", "Content":"Send Everyone Email list update" }, "1": { "Type":"Content", "Parameter":"description", "Content":"send everyone email csv to REDACTED" }, "2": { "Type":"Content", "Parameter":"RequestType", "Content":"Service Request" }, "3": { "Type":"Content", "Parameter":"customerId", "Content":"REDACTED" }, "4": { "Type":"Content", "Parameter":"teamId", "Content":"ICT_Infrastructure" }, "5": { "Type":"Content", "Parameter":"serviceId", "Content":"133" }, "6": { "Type":"Content", "Parameter":"catalogId", "Content":"1089" }, "7": { "Type":"Content", "Parameter":"catalogName", "Content":"API: Infrastructure Scheduled Requests" } } } ] } Link to comment Share on other sites More sharing options...
Steve Giller Posted June 9, 2023 Share Posted June 9, 2023 @Berto2002 Please review the members of the ICT and Digital group - I have checked this via the passcode you provided on the Incident and the User's name is not there. I could be mistaken but I have checked more times than Santa. Further to that, the specific Catalog Item, API: Infrastructure Scheduled Requests, is restricted using the Manage Catalog Visibility option to only the Testing Team, so even as part of the ICT and Digital group the User would not be subscribed. It's not an API I use, so I'll get one of the Developers to take a look at the other questions. Link to comment Share on other sites More sharing options...
Berto2002 Posted June 9, 2023 Author Share Posted June 9, 2023 @Steve Giller we altered the customerID that we are passing through to our lead tech who IS in that ICT and Digital OG. Sorry I did not tell you but 'Trudi' is not the one we are using here. We don't want these 'back-end / internal' cat items to be exposed to users. If I recall correctly, Subscriptions do work, even if the Manage Catalog Visibility options mask them from the portal; we use that in other areas to have Users' requests 'spawn back-end tickets for internal actions. I'm wondering whether "customerId" needs to be something like "urn:sys:user:FirstSecond@domain.gov.uk". Link to comment Share on other sites More sharing options...
Steve Giller Posted June 9, 2023 Share Posted June 9, 2023 I'd suggest as a first step providing a Customer Type, although this is optional it may be required when a Customer ID is provided, as the required value varies based on Customer Type. Link to comment Share on other sites More sharing options...
Steve Giller Posted June 9, 2023 Share Posted June 9, 2023 I've just noticed that RequestType should be requestType - APIs are case-sensitive so that will also need correcting. Link to comment Share on other sites More sharing options...
Berto2002 Posted June 9, 2023 Author Share Posted June 9, 2023 1 hour ago, Steve Giller said: I'd suggest as a first step providing a Customer Type, although this is optional it may be required when a Customer ID is provided, as the required value varies based on Customer Type. I'll have a hunt around. I think you mean to try to find a suitable value to put in to represent this which is from the User's record in the User and Guest Access area of the GUI: If you have the exact field name / table handy or where to find suitable values let me know... I know it's not in the h_sys_accounts table... h_sys_app_users has a list of my Users of that type... Link to comment Share on other sites More sharing options...
Steve Giller Posted June 9, 2023 Share Posted June 9, 2023 @Berto2002 The required values are specified in the API documentation. Also, I have discovered that the case mismatch on the requestType is almost certainly the reason for the bpm not spawning. Link to comment Share on other sites More sharing options...
Berto2002 Posted June 14, 2023 Author Share Posted June 14, 2023 @Steve Giller ok so we corrected to "requestType" and we added-in customerType (value "0" for Co-worker) but no change I'm afraid; it's still not allocating a Customer to the Request. Link to comment Share on other sites More sharing options...
Berto2002 Posted June 16, 2023 Author Share Posted June 16, 2023 @Martyn Houghton Hi. We're really struggling to get this to do what it is supposed to do. I gather you have this working? We can get it to create a Request but we cannot get that assigned to a Customer and nor can we get a particular BPM to engage. Any chance you can please send me an example of one of your working configuration files (or paste here) so we can critically review it against ours, please? Link to comment Share on other sites More sharing options...
Steve Giller Posted June 16, 2023 Share Posted June 16, 2023 On 6/14/2023 at 1:06 PM, Berto2002 said: we added-in customerType (value "0" for Co-worker) Where? (The call will be order-specific) A working API call that we used was: <methodCall service="apps/com.hornbill.servicemanager/ServiceRequests" method="logServiceRequest"> <params> <summary>test</summary> <description>test</description> <customerId>5025</customerId> <customerType>1</customerType> <ownerId>ownerId</ownerId> <teamId>test/team/</teamId> <status>status.open</status> <sourceType>Analyst</sourceType> <sourceId>userId</sourceId> <serviceId>28466</serviceId> <catalogId>57784</catalogId> <catalogName>SR catalog</catalogName> <bpmName>example-hornbill-service-request-process</bpmName> </params> </methodCall> Link to comment Share on other sites More sharing options...
Berto2002 Posted June 16, 2023 Author Share Posted June 16, 2023 @JamesGreen please see above ORDER. Link to comment Share on other sites More sharing options...
Steve Giller Posted June 16, 2023 Share Posted June 16, 2023 The full order is detailed in the API Documentation. Link to comment Share on other sites More sharing options...
Martyn Houghton Posted June 17, 2023 Share Posted June 17, 2023 On 6/16/2023 at 8:31 AM, Berto2002 said: Any chance you can please send me an example of one of your working configuration files (or paste here) so we can critically review it against ours, please? @Berto2002 I have PM'ed you our API Schedule JSON file. Cheers Martyn 1 Link to comment Share on other sites More sharing options...
Berto2002 Posted June 21, 2023 Author Share Posted June 21, 2023 Removed, thinking... Link to comment Share on other sites More sharing options...
Berto2002 Posted June 21, 2023 Author Share Posted June 21, 2023 We are up and running with the API Scheduler. Learning points: APIs are precise: for example, order and case matter Issues may be caused by seemingly unrelated aspects such as requestType case being wrong may still log a request but not populate other fields Forums are useful and people help! Thanks everyone! 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