Jump to content

customerId field on API Scheduler not giving the result of listing Customer on a Request


Recommended Posts

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

image.thumb.png.ae0b1ffe923e3c9919deee1da2079360.png

We use email address as the ID in all cases:

image.png.115b4a9076864665c7af96bef6b85a71.png

 

image.thumb.png.654eb8fa740eae11b5993994258672e8.png

 

Both the desired Customer (james) and the admin ID are Subscribers to the Service under which this is being created.

image.png.5aa02c8e985a48d64ece4cab8df70f60.png

Any help would be appreciated.

Link to comment
Share on other sites

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

  • 3 weeks later...
  • 3 months later...

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

image.thumb.png.e650ff8ae70dc14663d0afc54369a4de.png

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

@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

@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

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:

image.png.44f3ed1ad45c8160dac79535437b878a.png

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

@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

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

We are up and running with the API Scheduler.

Learning points:

  1. APIs are precise: for example, order and case matter
  2. Issues may be caused by seemingly unrelated aspects such as requestType case being wrong may still log a request but not populate other fields
  3. Forums are useful and people help!

Thanks everyone!

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