Hi @all,
I create an Issue via the JIRA-JAVA-API (a little bit old school)...
Everything works fine, but I can't add components, maybe someone knows, what is wrong....
MutableIssue issue = issueFactory.getIssue(); ... ProjectComponent component = null; component = ComponentAccessor.getProjectComponentManager().find(cid); issue.getComponentObjects().add(component); ... im.createIssueObject(user.getDirectoryUser(), issue);
The code above is a little bit simplified...
While debugging, the component object is exactly what I want and what I expected.
But, everything is set fine but not the component which is not set...
So... Any ideas?
Regards
Steve
Community moderators have prevented the ability to post new answers.
Hi Steve!
I think you need to use setComponentObjects:
component = ComponentAccessor.getProjectComponentManager().find(cid); issue.setComponentObjects(issue.getComponentObjects().add(component));
The javadoc says nothing what getComponentObjects returns when there is no components and I just thought that it might return null. Anyway you will discover this while testing :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, I should go looking for some glasses :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.