Jump to content

Recommended Posts

Posted

Hi,

When using the logServiceRequest there are the options to send questionFieldMap and connectionMap

There aren't any examples on how this should be sent on the docs page Entity API / logServiceRequest (hornbill.com)

We have assumed that the questions should be set something like this

            questionFieldMap = @{

                    "Request_Intake" = @{  -- where this is the form ID on the intelligent capture 

                        "field_0" = "Value to be sent"

                        "field_1" = "Value to be sent"

                    }

 

This doesn't seem to be working

Can we have some examples please?

Posted

The questionFieldMap parameter is for mapping the answers to custom fields on the request. As such if for example you wanted to map the "field_0" and "field_1" answers to custom A and B respectively, it's looking for JSON formatted as such:
 

{
    "h_custom_a":  "Value to be sent",
    "h_custom_b":  "Value to be sent"
}

It sounds to me like instead you're trying to fill in the form questions, which need to go in the "questions" parameter. Again it's looking for JSON format:

    {
        "form_id":  "Request_Intake",
        "question":  "What is the answer to field 0?",
        "question_id":  "field_0",
        "answer":  "Value to be sent (this is the display value)",
        "answer_value":  "Value to be sent (this is the raw value)",
        "field_type":  "text",
        "entity_type":  "request"
    },
    {
        "form_id":  "Request_Intake",
        "question":  "What is the answer to field 1?",
        "question_id":  "field_1",
        "answer":  "Value to be sent",
        "answer_value":  "Value to be sent",
        "field_type":  "text",
        "entity_type":  "request"
    }

Please note this is just an example along the lines of what has worked for us. I believe Hornbill staff have commented on similar posts in the past to suggest that the reason they haven't documented this part of the API fully is because it may still be under development? 

Posted

@CraigP Thanks for the response

 

What I have tried sending is

    "@service" = "apps/com.hornbill.servicemanager/ServiceRequests"
    "@method" = "logServiceRequest"
    params = @{
        summary = "Test Summary"
        description = "Test Description"
        questions = @{
            form_id = "General_Enquiy_Portal_1"
            question = "Details"
            question_id = "field_0"
            answer = "Test Value"
            answer_value = "Test Value"
            field_type = "text"
            entity_type = "request"
        }
    }
} | ConvertTo-Json -Depth 5

 

And we are now getting the below error...

@status state
------- -----
  False @{code=0203; error=The parameter 'methodCall/params/questions/question' was not expected}
 

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