Jump to content

Hornbill API - update custom fields via JSON


Recommended Posts

Hi all,

Please can someone advise if there are any good resources for investigating how to update 'custom fields' in Service Manager tickets via the Hornbill API?

Some background - we're investigating how we can add an integer to a customer field within a Known Error ticket. We need to calculate the integer value elsewhere, and then update the custom field via XMLMC.

From looking through api.hornbill.com I can see the below, but some examples of how the JSON representation is done within a python script would be very helpful. We'll be using a variation of the example.py script (https://github.com/hornbill/pythonApiLib/blob/master/python_api_lib/example.py)

customFields

xs:string

optional

A JSON representation of the custom fields for a request

 

Thanks

Rod

Link to comment
Share on other sites

Hi @rodb,

You'll have to supply a JSON object (consisting of the column(s) that are prefixed with "h_custom_" - which can be found in h_itsm_requests table) in form of a String. You'll have to declare a String in your Python script and assign a value as the example below:

myVariable = "{'h_custom_a': 'My Value', 'h_custom_b': 'Some Value', 'h_custom_26': 15000}"

Notice that h_custom_26 to h_custom_30 columns in h_itsm_requests table are INTEGER columns.

Hope this helps.

Ehsan

 

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
 Share

×
×
  • Create New...