taskadapter / redmine-java-api

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

Cannot create Issue #289

Closed mchl7 closed 7 years ago

mchl7 commented 7 years ago

Hi everybody,

I currently am facing a weird problem when trying to create an issue in redmine. The problem I am having is, everytime I try to create an Issue via the Redmine Java API, the redmine server responds with an Exception because my custom field isn't set.

The exception is thrown at the second line, when trying to create the issue. When I try to set the custom field beforehand, it will result in a null pointer exception (probably because I cannot set a custom field before creating an issue?)

This is my code: // Create issue Issue issueToCreate = IssueFactory.create(154, "some subject"); Issue createdIssue = issueManager.createIssue(issueToCreate);

Has anyone encountered the same problem or is this maybe even a known bug?

Thanks in advance!

csonuryilmaz commented 7 years ago

Is your custom field required? If it's required, please set it to empty from administration > workflow. By this way it'll be optional and I hope redmine won't give exception when creating new issue.

alexeyOnGitHub commented 7 years ago

here is an example how to create or update an issue with a custom field: https://github.com/taskadapter/redmine-java-api#set-custom-field-value-on-issue if your custom field is set to Required in Redmine but you do not provide it as shown in the example, creating issue won't work.

mchl7 commented 7 years ago

Sorry for the late answer:

The problem was that the user i was logged in with didnt have the the right to use the custom field. When I logged in via browser, i saw that the field wasn't visible for me. When trying to set that field, I got an RedmineException. I thought I would get a different exception in such case, thats what confused me.