APIs & Integrations

zosionlee
Participante

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

resolver

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 Me gusta
1 Soluciones aceptada
WendyGoh
Solución
HubSpot Employee
HubSpot Employee

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

resolver

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!

Ver la solución en mensaje original publicado

2 Respuestas 2
WendyGoh
Solución
HubSpot Employee
HubSpot Employee

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

resolver

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
Participante

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

resolver

Thand you