Web service method editing custom attribute

I'm trying to use a web service method to edit a responsible group automatically, and can get it to do that, but since custom attributes were not declared in the method, they are getting nulled. In the API documentation it isn't quite clear how to declare custom attributes within API calls. I am posting https://umt.teamdynamix.com/TDWebApi/api/{appId}/tickets/{id}?notifyNewResponsible={notifyNewResponsible} to edit a ticket.

below is current method body, the second to last line is where the trouble lies. I'm not sure the formatting on declaring a custom attribute to include it in the method.
{
"TypeID":42615,
"Title":"{{title}}",
"AccountID":"{{department}}", 
"StatusID":175314, 
"FormID":62381, 
"PriorityID":4032, 
"Description": "{{description}}",
"RequestorUID":"{{requestorID}}",
"Attributes.TeamDynamix.Api.CustomAttributes.CustomAttribute[155231]":"{{email}}",
"ResponsibleGroupID":23097
}

Tags API accountattributes
Asked by Derek Hickman on Wed 7/3/24 3:33 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Wed 7/3/24 3:55 PM

Hi Derek,

If you're editing tickets to just change responsible, it would probably be better to just use the PATCH endpoint so you only have to specify the exact field(s) that you *do* want to modify.

Have you looked into that route at all?

As far as attributes on a ticket object goes, they are an array comprised of one object per attribute that you need to be declaring, like so:

"Attributes": [ {"ID":12345, "Value":"ValueHere"},{"ID":67890, "Value":"OtherValue"},{etc.} ]

Though it does potentially depend on the type of custom attribute you're trying to provide a value for, like a text attribute vs a multi-select/choice-based attribute.

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
Patch would serve just fine, I didn't think about that, thank you for your help. - Derek Hickman Wed 7/3/24 4:00 PM