Create a Ticket with API and populate custom attribute fields.

I can create a ticket but the custom attribute filed are not populating.  What is the proper way to include the array in the POST to create a ticket?

I tried:

{

   ... all the stuff that works above

    TeamDynamix.Api.CustomAttributes.CustomAttribute[    
       "attribute1_name": "attribute1_value",
       "attribute2_name": "attribute1_value"]
}

https://support.csuchico.edu/TDWebApi/Home/type/TeamDynamix.Api.CustomAttributes.CustomAttribut

Asked by Scott Cory on Thu 9/12/24 1:42 PM Last edited Thu 9/12/24 1:43 PM
Sign In to leave feedback or contribute an answer

Answers (2)

This answer has been marked as the accepted answer
Scott Cory Thu 9/12/24 3:31 PM

Thanks Mark! I actually found the solution here:  https://solutions.teamdynamix.com/TDClient/1965/Portal/KB/ArticleDet?ID=18608

There is a comma at the end of the array in the example that kept giving me a json error.

 

 

No feedback

Mark Sayers Thu 9/12/24 2:37 PM

Hi Scott,

In the custom attributes array, which in a JSON ticket body is referred to like so:

{properties here

"Attributes": [{"ID":12345, "Value":"value here"},]

}

Note that you really only need to specify the ID of each attribute, and then its value to allow the call to succeed in specifying that attribute needs adding to the created ticket.

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback