Jump to content

Update Attribute and/or Activity Stream


Recommended Posts

I have a scenario where I would like to post text data capture from a client into a Service Request through the API.

At present I would like to use either 

1) A request custom attribute to store the data 

Not sure of what Hornbill Service Manager Requests function is best to do this.

or 

2) A request activity stream entry with a specific type

I have successfully done this using  "https://api.hornbill.com/apps/com.hornbill.servicemanager/Requests?op=updateReqTimeline"

However, once the data is posted I then want to be able to search / find the values via the API

For both scenarios above I am not sure of the correct Requests function to do this.

Any assistance would be greatly appreciated.

Kind Regards

Ben

 

Link to comment
Share on other sites

Hi @Ben Paddick,

You can use the Custom columns in a Request to store additional data/information. The options are: h_custom_a, h_custom_b, h_custom_c, h_custom_d, h_custom_e, h_custom_f, h_custom_g, h_custom_h, h_custom_i, h_custom_j, h_custom_k, h_custom_l, h_custom_m, h_custom_n, h_custom_o, h_custom_p, h_custom_q, h_custom_r, h_custom_s, h_custom_t, h_custom_21, h_custom_22, h_custom_23, h_custom_24, h_custom_25, h_custom_26, h_custom_27, h_custom_28, h_custom_29 and h_custom_30.

You can update any of or all of the Custom columns via customFields parameter in Requests::update API.

"customFields" requires you to supply a JSON object in form of a string. For example, to update h_custom_a and h_custom_b attributes in a Request, you'll need to build a string as below...

  • {"h_custom_a": "someValueA", "h_custom_b": "someValueB"}

image.png

If desired, you could then display the Custom attributes within the Details section of Requests. Through the Form Designer (Expand Details section > Click on "Design" button - Ensure that Form Designer role is assigned to your user otherwise you'll not be able to design forms), you can add any of the Custom attributes to the Details section.

image.png

I would recommend this approach.

Hope this helps.

Ehsan

Link to comment
Share on other sites

  • 3 weeks later...

So I have tested the API "update" method Ehsan has kindly suggested. 

The method accepts the request parameters but does not update the actual details of the SR.

I have tried using " requestId" with combination of the following optional parameters "h_summary", "h_description", " h_external_ref_number" and "customFields".

Looks like a bug to me as the other request update API mehtods like Hi updateReqTimeline work fine.

Maybe an expert like @Steve G can shed some light?

Link to comment
Share on other sites

  • 1 month later...

Hi Hornbill Integration team!

@Ehsan @Steve G

I am still struggling with the above issue. I am not able to update using op=update. 

The API staus is ok so it looks to have submitted.

Any ideas? Is this working for others? Are there any special permissions? I can update the fields via the GUI using my account.

Thanks

Ben

 

Link to comment
Share on other sites

Hi @Ben Paddick,

Requests::update API returns 2 Output Parameters, in the event of an error. Are you able to confirm the values that are returned by the API?

image.png


In order to update a Request, you'll need to have visibility to it. Are you performing this action as an admin or someone who would have rights to access the Request? Could you provide us with an example of the value you're passing to customField input parameter?

 

Link to comment
Share on other sites

Hi @Ehsan

Thank you for getting back to me.

FYI - I am using the Power Shell module to interact with the API.

If I test with trying to update "h_external_ref_number" and/or "h_description" I do not get any errors back.

These are the values:

$xmlmcOutput.status = "ok"
$xmlmcOutput.error = NULL
$xmlmcOutput.exceptionName = NULL
$xmlmcOutput.exceptionDescription = NULL

I have cut the script right back to just the following f

Add-Param "requestId" "SR00167255"
#Add-Param "h_summary" "Summary blah blah again"
Add-Param "h_description" "description blah blah again"
Add-Param "h_external_ref_number" "1234567" 
#Add-Param "customFields" "{"h_custom_p": "someValueA"}"
 
# Invoke XMLMC call - Get all Service Request that match search query, output returned as PSObject
$xmlmcOutput = Invoke-XMLMC "apps/com.hornbill.servicemanager/Requests" "update"
# Read output status
    
    if($xmlmcOutput.status -eq "ok") {  
        
            "No error returned - here are outputs"
            "API Call Status : " + $xmlmcOutput.status
            "APIError Returned  : " + $xmlmcOutput.error
            "API Excption Name : " + $xmlmcOutput.exceptionName
            "API Excption Description  : " + $xmlmcOutput.exceptionDescription
        
            }
 
        else {
 
            "An error was returned - here are outputs"
            "API Call Status : " + $xmlmcOutput.status
            "APIError Returned  : " + $xmlmcOutput.error
            "API Excption Name : " + $xmlmcOutput.exceptionName
            "API Excption Description  : " + $xmlmcOutput.exceptionDescription
        }

I am running the connection to the API using an API key for my account. I believe this should therefore have the same permissions as what I do via the GUI?

Any further ideas? Does this work for you within your instance?

Many thanks

Ben

 

 
Link to comment
Share on other sites

@Ben Paddick,

Great. I'll update the operation to not require a value to be passed to customFields, as per the API documentation. I'm wondering why exceptionName Output Parameter was not set :( I suppose the error has did appear in the EspServerService log. 

Ehsan

Link to comment
Share on other sites

  • 1 year later...
Guest Paul Alexander

Hi @Ehsan

Could you please take a look here? We're trying to use the same 'update' API call as Ben was but we ARE trying to update the custom fields (he wasn't!). Any pointers would be great please! 

 

 

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