APIs & Integrations

zosionlee
Participant

How can we custom a ticket property to store json string?

SOLVE

When we use api to create a ticket, the kwargs is contain json string, so we want custom a property to store the json string, but how can we achieve ?

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How can we custom a ticket property to store json string?

SOLVE

Hey @zosionlee,

 

When looking to store JSON string to a custom property, you can do the following:

 

1. Create a custom property with 'Multi-line text' field type

2. Escaped the json string e.g. 

 

{name: \"John\", age: 31, city: \"New York\"};

3. Send the escaped json string as the value e.g.

 

[
  {
    "name": "subject",
    "value": "feb test ticket"
  },
  {
    "name": "content",
    "value": "Here are the details of the ticket."
  },
  {
    "name": "hs_pipeline",
    "value": "0"
  },
  {
    "name": "hs_pipeline_stage",
    "value": "1"
  },
{
"name": "testtostorejsonstring",
"value": "{name: \"John\", age: 31, city: \"New York\"};"

}
]

I have tested it out and it works. Let me know if this works for you!

View solution in original post

2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How can we custom a ticket property to store json string?

SOLVE

Hey @zosionlee,

 

When looking to store JSON string to a custom property, you can do the following:

 

1. Create a custom property with 'Multi-line text' field type

2. Escaped the json string e.g. 

 

{name: \"John\", age: 31, city: \"New York\"};

3. Send the escaped json string as the value e.g.

 

[
  {
    "name": "subject",
    "value": "feb test ticket"
  },
  {
    "name": "content",
    "value": "Here are the details of the ticket."
  },
  {
    "name": "hs_pipeline",
    "value": "0"
  },
  {
    "name": "hs_pipeline_stage",
    "value": "1"
  },
{
"name": "testtostorejsonstring",
"value": "{name: \"John\", age: 31, city: \"New York\"};"

}
]

I have tested it out and it works. Let me know if this works for you!

zosionlee
Participant

How can we custom a ticket property to store json string?

SOLVE

Thand you