Jump to content

logChangeRequest and Change Scheduling pointers please?


Recommended Posts

We're successfully using the API scheduler to log Requests. Now to do Change Requests...

Using this: Operation - com.hornbill.servicemanager::ChangeRequests/logChangeRequest I created my JSON file but then I realised that change scheduling is a different page: Operation - com.hornbill.servicemanager::ChangeRequests/schedule

Question: can I append the fields from the ChangeRequests/Schedule to the initial list of parameters in the JSON file so the Change gets scheduled when first logged? Or do I have to complete once operation, receive the RequestiD and then have another operation to update the CR with the Schedule details?

Link to comment
Share on other sites

@Berto2002 first, JSON? Not yet supported...might work...might not... second, you can only have a payload using the available parameters listed on https://api.hornbill.com/apps/com.hornbill.servicemanager/ChangeRequests?op=logChangeRequest. If there are no params for schedule data (there are none) then no, you can't append this data as the API will fail since you are sending data the API does not know about. So you need to have the request raised, then use the schedule.

Link to comment
Share on other sites

On 26/09/2023 at 15:59, Victor said:

JSON

Maybe I mentioned the wrong thing...

It looks like this:

 

{
  "APIKey": "xxx",
  "InstanceID": "xxx",
  "Schedule": [{
    "Enabled": true,
    "CronSchedule": "0 30 8 * * 1",
    "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":"Patching Updates - Test - 2nd Weds of the month"
        },
        "1":
        {
            "Type":"Content",
            "Parameter":"description",
            "Content":"xxx."
        },
        "2":
        {
            "Type":"Content",
            "Parameter":"requestType",
            "Content":"Change Request"
        },    
        "3":
        {
            "Type":"Content",
            "Parameter":"customerId",
            "Content":"ServiceDesk@xxx.gov.uk"
        },
    "4":
    {
        "Type":"Content",
        "Parameter":"customerType",
        "Content":"0"
 

Link to comment
Share on other sites

@Berto2002 so using the API scheduler, which, yes, has a JSON config file. I thought you were invoking the APIs using your own tools/scripts/program. Using the API scheduler you won't be able to do the scheduling since you need the request reference as an input param and this needs to go in the config file.... unless you manually add this in the config file, for each request raised, which negates the automation completely... Also, you need a new API ky assuming the one you posted above is a valid one... 

Link to comment
Share on other sites

2 hours ago, Berto2002 said:

@Victor can you please remove our API key from this forum...

I can but there is little value in doing this since it has been exposed already...

2 hours ago, Berto2002 said:

@Victor Can the API Scheduler not receive the RequestId back from the first call to logChangeReqyest and input that into the RequestId field for the Scheduling call?

No, it can't. You need dynamic or runtime values here and this concept does not exist in the API scheduler. You can achieve this with a custom solution but someone would have to develop this solution (script/program/etc.)

Link to comment
Share on other sites

1 minute ago, Berto2002 said:

Do you know when the Scheduler feature in Service Manager will be released and if that will enable us to raise scheduled change requests?

No, I don't know this I'm afraid. All the info I have about new features is what is also made public in the Roadmap, which is what you also have...

Link to comment
Share on other sites

I could try Workflow wizardry.

Anyone tried/know how we might find the 1st Wednesday of the month reliably using BPM nodes...?

I think I can do this based on when the API Scheduler creates the CRs.

It will always creates them on set days (either the 2nd or the 4th Tuesday). Thus, the following Wednesday (+8 days) should always be the target Wednesday. That translation is pretty safe to get the 3rd as +8 from the 2nd but the wrap-around from the 4th Tuesday to the 1st Wednesday is not so safe. Need to have a think.

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