-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Inconsistant 422 Errors Unprocessable Entity - Updating Trigger #226
Comments
Can you submit a test case that has this issue? I understand that sometimes the test will pass and sometimes it will fail. |
The code I put in there is 100 reproable all the time. The issue is that zendesk expects an id (eg 5) for the update method. When you get the entity, it has the value (API). So, a get, followed by update the trigger object to enable/disable ,followed by an update will fail all the time. Thank you, |
Would you please create a test with the full workflow and submit it as a pull request and we will see about getting the issue fixed. |
# THE CAUSE I had a look into this and can confirm a bug (probably on zendesk side). The trigger condition "Update Via" in the web UI corresponds to the "current_via_id" API field which expects an ID value corresponding to a via type. The problem is that when retrieving the trigger, zendesk API sends: "any" : [{
"field" : "current_via_id",
"operator" : "is_not",
"value" : "web"
}
] which is the name value instead of the ID. This makes the API spit an error when trying to update the Trigger on the next update. # TEST CODE
var myTrig = _zendeskApi.Triggers.GetTriggerById(<<insert_trigger_id>>).Trigger;
myTrig.Active = true;
_zendeskApi.Triggers.UpdateTrigger(myTrig); |
Submitted a ticket to zendesk support and waiting for an answer. |
Given that this is zendesk issue and the support ticket has been opened with them. I am closing this issue. |
Hello,
I have some simple code that intends to enable an existing disabled trigger. here is the code and the error:
IndividualTriggerResponse z = zenApi.Triggers.GetTriggerById(triggerId);
z.Trigger.Active = true;
zenApi.Triggers.UpdateTrigger(zenTriggerResponse.Trigger);
The error:
System.Net.WebException was unhandled
HResult=-2146233079
Message=The remote server returned an error: (422) Unprocessable Entity.Error content: {"error":"RecordInvalid","description":"Record validation errors","details":{"base":[{"description":"Invalid value 'web' in 'Update via / Is not / web'"}]}}
The trigger has a condition: Is Not updated via web Form. Somehow that makes the update unhappy. If i remove that condition, the update works.
{
"field": "current_via_id",
"operator": "is_not",
"value": "web"
},
The text was updated successfully, but these errors were encountered: