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

Unable to update organization after adding tag #109

Closed
AlexisVZ opened this issue Oct 31, 2014 · 8 comments
Closed

Unable to update organization after adding tag #109

AlexisVZ opened this issue Oct 31, 2014 · 8 comments

Comments

@AlexisVZ
Copy link
Contributor

Hallo,

I have code for updating an organization which runs fine. Thanks Erik !.

But now I tried to add a tag to an organization by adding the following code (VB.net), before the UpdateOrganization method:
Dim Tag As New ZendeskApi_v2.Models.Tags.Tag
Tag.Name = "MM"
Organization.Tags.Add(Tag)
api.Organizations.UpdateOrganization(Organization)

But after adding this code I receive the following error upon calling UpdateOrganization: "The remote server returned an error: (400) Bad Request."

Any help much appreciated.
Alexis

@artfulhacker
Copy link

@AlexisVZ can you update any information in the organization? i get 422 unprocessable entry no matter what

@AlexisVZ
Copy link
Contributor Author

Hello Mike,

Yes I can, but only after the change illustrated in attached screenshot:

[cid:[email protected]]

Good luck !
Alexis

From: Mike Olsen [mailto:[email protected]]
Sent: dimanche 21 décembre 2014 08:02
To: eneifert/ZendeskApi_v2
Cc: Alexis Van Zeveren
Subject: Re: [ZendeskApi_v2] Unable to update organization after adding tag (#109)

@AlexisVZhttps://github.com/AlexisVZ can you update any information in the organization? i get 422 unprocessable entry no matter what


Reply to this email directly or view it on GitHubhttps://github.com//issues/109#issuecomment-67762200.

@cdw2025
Copy link

cdw2025 commented Feb 20, 2015

I see no attached screenshot [cid:[email protected]], but I need help with this exact problem. Thanks.

@artfulhacker
Copy link

Yea same. I figured it out, you can't reuse the Organization object response. I had to build a new one, copy the attributes over (the one I wanted to change) and send that with the request. Not impressed with this API or library after using it for several months now.

@cdw2025
Copy link

cdw2025 commented Feb 21, 2015

Thanks for the quick response!!! I'll try that.

I've also found that if you send the JSON over with:

/{org id}/tags.json "{"tags":["claims","eligibility","statements"]}"

that it works just fine! The same holds true for CustomFields as well.

None of this supported by this API wrapper of course. I had to futz the JSON before the request was sent.

@mozts2005
Copy link
Member

Will look at ways to make this better. Please post any ideas for ways we can make this better for every one.

@mozts2005 mozts2005 added this to the 4.0.0 milestone Aug 20, 2015
@StephenMP
Copy link

I'm unable to reproduce this issue using the latest code. The following code executes just fine:

var tag = new Tag();
var organization = api.Organizations.GetOrganizations().Organizations.First();
tag.Name = "MM";
organization.Tags.Add(tag.Name);

var org = api.Organizations.UpdateOrganization(organization);
org.Organization.Tags.Add("New");

var org2 = api.Organizations.UpdateOrganization(org.Organization);
org2.Organization.Tags.Remove("MM");
org2.Organization.Tags.Remove("New");
api.Organizations.UpdateOrganization(org2.Organization);

@mozts2005
Copy link
Member

@StephenMP Would you please submit a pull request adding your code as a test case?

I am going to close this issue at this time. if more information becomes available we can reopen.

@mozts2005 mozts2005 modified the milestones: 4.0.0, 3.5.0 Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants