APIs & Integrations

zosionlee
Participant

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

Résolue

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 Votes
1 Solution acceptée
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

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

Résolue

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!

Voir la solution dans l'envoi d'origine

2 Réponses
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

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

Résolue

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?

Résolue

Thand you