Referencing custom attributes in web services api post

This might be more of a json question -

To create a new ticket via web services workflow & specify a value for a certain custom attribute, how does one reference the attribute in the post?  The posts work fine, except that the custom attribute info doesn't get into the new ticket.

Here's an example with fake info:

making a post to{appid}/tickets

"Title":"Project Approved: {{OrigTitle}}",

... where I'm trying to reference custom attribute with id "12345" in the 3rd line from the bottom.  I've tried several different syntaxes for that line and have referenced the docs at , but I don't seem to have it right.

Tags API web-services custom-attribute custom-attributes
Asked by David Durling on Fri 2/15/19 10:59 AM Last edited Fri 2/15/19 1:44 PM
Sign In to leave feedback or contribute an answer

Answers (2)

This answer has been marked as the accepted answer
Mark Sayers Fri 2/15/19 5:06 PM

Hi David,

Sorry for the delay in getting back to you on this but we were working through the proper syntax to include a custom attribute array in your ticket update call.

So the Attributes section should be a JSON list that would look something like this (all values are purely for example, replace with your own values if you test with this):

 "Attributes":[{"Name":"NameOfYourAttribute", "Order":"5","ID":"1278", "Value":"3778"}]

I don't think "Order" particularly matters, but it says that it is a required property. You could try excluding it I suppose if you wanted to test. You *do* need ID which is the ID of that custom attribute, and "Value" in this case was the ID of a choice option on a dropdown attribute. That could be text if your attribute is just a text attribute.

Let me know if this helps.

Mark Sayers
TD Support

1 of 1 users found this helpful.

David Durling Mon 2/18/19 2:12 PM

Thank you, that does the trick!  Someone on our web team got me to the same solution just now (because I hadn't read your response yet), and it works.

No feedback