taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
269 stars 162 forks source link

update issue #342

Open vvmsalat opened 4 years ago

vvmsalat commented 4 years ago

Hi @alexeyOnGitHub & Co How to update an issue with api 4? Like below i'm getting a NullPointerException in bean.Issue.update(). Same with issue.update(); This worked though in earlier versions.

issue.getCustomFieldByName("kontrolle").setValue("1"); issue.getCustomFieldByName("itf_datei").setValue(itf); issue.setDescription(desc); issue.setSubject(subject); mgr.getIssueManager().update(issue);

thanks for help!

vvmsalat commented 4 years ago

just when i gave up i reread the readme... i tried this and it works! Transport t = mgr.getTransport();' t.updateObject(issue);

Last bit of section 'Set custom field value on issue' in readme has to be changed.

alexeyOnGitHub commented 4 years ago

you are welcome to submit a PR with proposed docs changes. I can take a look then

marepop commented 4 years ago

Hi, i cannot update the issue even with this workaround by using transport. The error is entity may not be null. There is no entity since this response returns a 204 no content (no body) but apache still throws this error. Any way to resolve this? issue.update() and t.updateObject(issue) both throw the same thing.

Error happens here: return handler.processContent(httpResponse); because final String charset = HttpUtil.getCharset(entity); is called on null entity.

hoehoe-tech commented 2 years ago

I think this problem caused by the same reason as #362 . So it has been modified from 4.0.0.rc4. I'm very thankful to @alexeyOnGitHub .

Attention. In the following URL site written in README.md and this project's top page, the older version 4.0.0.preview.3 is introduced as the latest version. Maybe search.maven.org has a bug or something. https://search.maven.org/search?q=g:com.taskadapter%20AND%20a:redmine-java-api

To get fixed version(4.0.0.rc4), I think we should access following URL. https://search.maven.org/artifact/com.taskadapter/redmine-java-api