Jump to content

API call fails to invoke BPM


Recommended Posts

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: 

image.thumb.png.d72cbbf675dae082a94cbb45b812b669.png

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?

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Guest Ehsan

@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)...

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

 

Link to comment
Share on other sites

  • 6 months later...

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

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

 

 

Link to comment
Share on other sites

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

image.png

 

Link to comment
Share on other sites

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>


 

Link to comment
Share on other sites

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

image.png

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