Jump to content

Recommended Posts

Posted

I have finally got the API working so we can update Hornbill tickets. However when trying to use the "Assign" parameter documented here Entity API / assign (hornbill.com), the "updateTimelineInputs" parameter does not seem to be accepted. I parse the mandatory fields for "inReference" and "inAssignToGroupId" which does assign the ticket to the relevant team but it ignores the "updateTimelineInputs".

I am sending the following JSON -

{
  "@service": "apps/com.hornbill.servicemanager/Requests",
  "@method": "assign",
  "params": {
    "inReference": "SRXXXXXXXX",
    "inAssignToGroupId": "ICT_ServiceDesk",
    "updateTimelineInputs": "Automation of shared mailbox permissions has failed. Please check the details provided are correct."
  }
}
 
On first run I get the following response -
 
{
    "@status": false,
    "state": {
        "code": "0207",
        "service": "apps",
        "operation": "assign",
        "error": "undefined(1): error X1001: Uncaught SyntaxError: Unexpected token A in JSON at position 0",
        "flowcodeError": {
            "where": "Execute",
            "filename": "undefined",
            "lineNumber": 1,
            "columnPos": 0,
            "message": "Uncaught SyntaxError: Unexpected token A in JSON at position 0",
            "errorCode": 1001,
            "stackTrace": [
                "requestSystemAssign at /apps/com.hornbill.servicemanager/entities/Requests/fc_modules/requests_helper.js(1617:68)",
                "requestAssign at /apps/com.hornbill.servicemanager/entities/Requests/fc_modules/requests_helper.js(1466:29)",
                " at /apps/com.hornbill.servicemanager/entities/Requests/fc_ops/assign.js(5:28)"
            ]
        }
    }
}
 
When I run it a second time (without making any changes) I get back -
 
{
    "@status": true,
    "params": {
        "assignToSameOwner": "1",
        "requestId": "SRXXXXXXXX"
    }
}

It then assigns to the specified team but there is no timeline update. 

I did notice the guidance for "updateTimelineInputs" mentions activityType, updateText, source, postType and visibility. However when I tried parsing these the response was that they are not recognised parameters (as below).

 

 

{
    "@status": false,
    "state": {
        "code": "0203",
        "error": "The parameter 'methodCall/params/updateTimelineInputs/updateText' was not expected"
    }
}
Posted
13 minutes ago, Steve Giller said:

image.png

You're not providing the parameter in the required format.

Could you please give me an example of how it should be structured?

The code example in the documentation just says "updateTimelineInputs":"xs:string",

Posted
9 minutes ago, Ben C said:

Could you please give me an example of how it should be structured?

Sadly not one I'm overly familiar with, but I'm sure someone will update shortly.

 

Posted
1 hour ago, Steve Giller said:

I believe the formatting should be:

"updateTimelineInputs":"{\"updateText\":\"UPDATE TEXT HERE\",\"source\":\"SOURCE IF REQUIRED\", etc}"

 

That got it working thank you!

Only problem I have now, that when passing the below via Power Automate, it see's anything with an @ symbol as dynamic content and errors when I try to save the HTTP action with the below in. Are there any workarounds for this?

"@service": "apps/com.hornbill.servicemanager/Requests",
  "@method": "assign",
 
 
Posted
1 hour ago, Ben C said:

That got it working thank you!

Only problem I have now, that when passing the below via Power Automate, it see's anything with an @ symbol as dynamic content and errors when I try to save the HTTP action with the below in. Are there any workarounds for this?

"@service": "apps/com.hornbill.servicemanager/Requests",
  "@method": "assign",
 
 

@Ben C 

you have to use the formula string() in power automate
for example: string('@service')

Posted
2 hours ago, Steve Giller said:

Generally speaking "special" characters can be escaped. What to escape them with would be a question for a PowerShell guru, though.

fun fact you can also escape the character in power automate by just doubling so you could @@ instead.

  • Thanks 1
Posted

Was able to resolve this issue by setting the parameters as @@service and @@method.

Thanks to forum member Jim for this resolution!

Posted

Just a warning though @Ben C, in Power Automate, if you come back letter to edit a flow, and you click into a HTTP node, it can reset @@ back to @... at least on the older look and feel of Power Automate.

The newer look and feel appears to retain the escaped @ symbol in the HTTP node, but still worth bearing in mind. You will get an error message when this occurs so a quick reminder is to check the HTTP actions you might have clicked into before you publish.

I use the @@ method myself and have gotten used to checking over the years.

Alternatively, do what @Giuseppe Iannacone suggested :) 

  • Like 1

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