Dan Munns Posted June 26, 2019 Posted June 26, 2019 Hi @Victor @Steve G Apologies for the tagging but I am having an issue with kicking of a BPM with an API So far I have this: It logs the request fine, against the correct service and CI, but there is no BPM assigned to it. The catalog item is set up with a BPM and the service has the same BPM set as the default under SRs Any ideas where we are going wrong?
Victor Posted June 26, 2019 Posted June 26, 2019 @Dan Munns - logRequest API is not designed to spawn the process so using only this means you won't have a workflow against the request. You would need to also invoke logRequestBPM (https://api.hornbill.com/apps/com.hornbill.servicemanager/Requests?op=logRequestBPM) and you need to pass the request ID as a parameter which is provided by logRequest API.
Dan Munns Posted June 26, 2019 Author Posted June 26, 2019 Ah ok. I was confused by the API description of serviceId: Quote serviceId xs:string optional The id of the selected service. This will be used to spawn a bpm process. No worries, I'll have a look at logRequestBPM then. Thanks @Victor
Victor Posted June 26, 2019 Posted June 26, 2019 @Dan Munns oh... hmm.... I see... well... the API itself does not spawn a BP so either the description is incorrect or the API needs to be redesigned to do the spawn... I'll take this with dev team Meanwhile, logRequestBPM would do the trick... 1
Dan Munns Posted June 26, 2019 Author Posted June 26, 2019 @Victor if the API could kick off a BP from either serviceId or catalogId (depending on lowest level set) that would be great. In the mean time we will look at logRequestBPM Thanks!
Victor Posted June 26, 2019 Posted June 26, 2019 Just now, Dan Munns said: if the API could kick off a BP from either serviceId or catalogId (depending on lowest level set) that would be great That's what logRequestBPM does... but yeah...
Dan Munns Posted June 26, 2019 Author Posted June 26, 2019 Would just mean that I didn't have to log a request, get the reference number then kick off the BPM. Lazy
Victor Posted June 26, 2019 Posted June 26, 2019 Just now, Dan Munns said: Would just mean that I didn't have to log a request, get the reference number then kick off the BPM. Yep, that's all that's needed
Victor Posted June 26, 2019 Posted June 26, 2019 The reference is provided in the API response from logRequest...
Dan Munns Posted June 26, 2019 Author Posted June 26, 2019 I know. But at the moment it takes around 30 - 50 seconds from kicking off the api to the call logging to complete. Then I have to invoke the BPM. If it could all be done at once it would just be...neater 1
Guest Ehsan Posted June 26, 2019 Posted June 26, 2019 @Dan Munns, Instead of invoking logRequest method, I would advise you to refer to the methods below (depending on the Request type you intend to raise)... https://api.hornbill.com/apps/com.hornbill.servicemanager/Incidents?op=logIncident https://api.hornbill.com/apps/com.hornbill.servicemanager/ServiceRequests?op=logServiceRequest https://api.hornbill.com/apps/com.hornbill.servicemanager/Problems?op=logProblem https://api.hornbill.com/apps/com.hornbill.servicemanager/KnownErrors?op=logKnownError https://api.hornbill.com/apps/com.hornbill.servicemanager/ChangeRequests?op=logChangeRequest https://api.hornbill.com/apps/com.hornbill.servicemanager/Releases?op=logRelease These methods will automatically kick off logRequest and logRequestBPM, so you don't have to chain the APIs in your code. By providing serviceId to any one of these methods, the Business Process that is associated to the supplied Service will be spawned, otherwise you can override the Business Process used via bpmName parameter. Hope this helps. Ehsan
Martijn Posted January 2, 2020 Posted January 2, 2020 Hi @Ehsan Im trying to utilize the LogServiceRequest api call. But im struggeling with the serviceID. to spawn the BPM process with it. no matter what i put in there results in "no service " warning. "summary": "Audit -> Test","warnings": "{\"noService\":\"The Request has no service so no valid business process available\"}" Even with or without the actual <bpmName>se-service-request-process</bpmName> Where can in find the correct id to use ? Thanks Martijn On 6/26/2019 at 3:24 PM, Ehsan said: Instead of invoking logRequest method, I would advise you to refer to the methods below (depending on the Request type you intend to raise)... https://api.hornbill.com/apps/com.hornbill.servicemanager/Incidents?op=logIncident https://api.hornbill.com/apps/com.hornbill.servicemanager/ServiceRequests?op=logServiceRequest https://api.hornbill.com/apps/com.hornbill.servicemanager/Problems?op=logProblem https://api.hornbill.com/apps/com.hornbill.servicemanager/KnownErrors?op=logKnownError https://api.hornbill.com/apps/com.hornbill.servicemanager/ChangeRequests?op=logChangeRequest https://api.hornbill.com/apps/com.hornbill.servicemanager/Releases?op=logRelease These methods will automatically kick off logRequest and logRequestBPM, so you don't have to chain the APIs in your code. By providing serviceId to any one of these methods, the Business Process that is associated to the supplied Service will be spawned, otherwise you can override the Business Process used via bpmName parameter. Hope this helps. Ehsan
Guest Ehsan Posted January 2, 2020 Posted January 2, 2020 @Martijn, Through the main menu > Service Manager Tile > Service Portfolio Tile, open the Service that you would like to raise the Request against. In the URL, you'll be able to find the If of the Service. An example as below.
Martijn Posted January 3, 2020 Posted January 3, 2020 mine is Id 7, if i put that in the No Service warning remains, it also does not pickup the BPM when posting it with the BPMName Tage in the xml. Thanks Marijn
Martijn Posted January 3, 2020 Posted January 3, 2020 @Ehsan Also tried on the Demo instance, same result there. 47 minutes ago, Martijn said: mine is Id 7, if i put that in the No Service warning remains, it also does not pickup the BPM when posting it with the BPMName Tage in the xml. Thanks Martijn
Guest Ehsan Posted January 3, 2020 Posted January 3, 2020 @Martijn, Could you please confirm that you've supplied serviceId and bpmName parameters?
Martijn Posted January 3, 2020 Posted January 3, 2020 Hi @Ehsan yes, i use both the ServiceID and the BPM Name variables. <methodCall service="apps/com.hornbill.servicemanager/ServiceRequests" method="logServiceRequest"> <params> <summary>Audit -> Test</summary> <description>Test</description> <requestType>Service Request</requestType> <customerId>m1</customerId> <customerType>0</customerType> <ownerId>md1</ownerId> <teamId>SE/DEP_IS/TM_IS_HFD/</teamId> <status>status.new</status> <priorityId>16</priorityId> <categoryId>229</categoryId> <categoryName>Scheduled Request</categoryName> <sourceType>Post</sourceType> <sourceId>Admin</sourceId> <!--<Impact></Impact>--> <!--<Urgency></Urgency>--> <serviceID>7</serviceID> <!--<Questions></Questions>--> <!--<ResolutionDetails></ResolutionDetails>--> <siteId>1</siteId> <siteName>Office</siteName> <CatalogID>83</CatalogID>--> <CatalogName>Audit</CatalogName> <bpmName>se-service-request-process</bpmName> </params> </methodCall>
Guest Ehsan Posted January 3, 2020 Posted January 3, 2020 @Martijn, In your payload, I can see reference to "serviceID"; The parameter must be declared as "serviceId". Also, please note that "catalogID" should be declared as "CatalogId". I also noticed that there is a trailing HTML comment left at the end of that line. When declaring parameters, please ensure that the case is respected as the XMLMC library enforces this check.
Martijn Posted January 3, 2020 Posted January 3, 2020 Hi @Ehsan ah, it works now, i failed to look a those fields correctly Thanks Martijn
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