Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem updating custom Ticket Fields Async #256

Closed
trosenfeld opened this issue Nov 24, 2016 · 4 comments
Closed

Problem updating custom Ticket Fields Async #256

trosenfeld opened this issue Nov 24, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@trosenfeld
Copy link

trosenfeld commented Nov 24, 2016

Hello,

Today I was trying to update a custom drop-down ticket field.
The request JSON isn't serializing properly.
It's currently being serialized as:
{"custom_field_options" : [{"name" : "Option 1", "value" : "option_1"},{"name" : "Option 2", "value" : "option_2"}]}
It should however be serialized as:
{"ticket_field": {"custom_field_options" : [{"name" : "Option 1", "value" : "option_1"},{"name" : "Option 2", "value" : "option_2"}]}}

As far as I can see the TicketField needs to be wrapped just as the response is. (See the CURL Example on the ZenDesk Developer Portal)
Either the IndividualTicketFieldResponse class should be used or a IndividualTicketFieldRequest class should be made which would be identical to the IndividualTicketFieldResponse class.

Currently when executing the request I'm receiving the X-Zendesk-API-Warn header with the following header value:
Removed restricted keys ["url", "created_at", "updated_at", "type", "title", "description", "position", "active", "required", "collapsed_for_agents", "title_in_portal", "visible_in_portal", "editable_in_portal", "required_in_portal", "custom_field_options"] from parameters according to whitelist

@mozts2005 mozts2005 added this to the v3.5.2 milestone Nov 28, 2016
@mozts2005
Copy link
Member

I am not able to replicate your issue. I do have a test case for this that can be found here

If you are abele to create a test that can replicate your issue and submit it as a pull request I would me more than happy to troubleshoot the issue more.

@mozts2005 mozts2005 assigned mozts2005 and unassigned mozts2005 Nov 29, 2016
@trosenfeld
Copy link
Author

Hi,

As I'm not that experienced with Github so haven't been able to create a pull request.
If you however make a copy of the unit test you referenced and use the Async methods the unit test will fail.
It probably would have been handy if I had mentioned in my initial post that I'm using the Async methods.

@mozts2005
Copy link
Member

@trosenfeld I have looked at the code for UpdateTicketField and UpdateTicketFieldAsync. I can see the issue.

I will get this fixed ASAP.

@mozts2005 mozts2005 self-assigned this Nov 30, 2016
@mozts2005 mozts2005 changed the title Problem updating custom Ticket Fields Problem updating custom Ticket Fields Async Nov 30, 2016
@mozts2005 mozts2005 mentioned this issue Nov 30, 2016
@mozts2005
Copy link
Member

Please have a look at the myget feed. version 3.5.3-alpha3 has the needed fix.

If you need help with myget we should be able to help. just ping me on gitter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants