Here is my code for IssueLinking...
ComponentManager com = ComponentManager.getInstance();
IssueLinkManager issueLinkManager = com.getIssueLinkManager(); //returns null pointer exception
JiraAuthenticationContext authenticationContext = com.getJiraAuthenticationContext();
issueLinkManager.createIssueLink(Long.parseLong(parentissue.getId()),Long.parseLong(childissue.getId()),10010L,1L,authenticationContext.getUser());
I get a NullPointerException while calling getIssueLinkManager()....
Please tell me how to solve this and link 2 existing issues...
Community moderators have prevented the ability to post new answers.
Are you sure the null pointer is thrown there? That line looks okay to me! You can may be add some debug statements to be sure.
The exception is thrown in that line only...
I donot know how to proceed.Can u tell me how to perform IssueLinking and what are the necessary jar files for it.
Thank you in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Import classes from atlassian-jira4.2.jar" sounds wrong to me
Again, can you tell us where you are doing this? (Answer the question you've been asked, please)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem for us here is that your code looks fine, so the answer to "how to perform issue linking" is "do what you're already doing"
I've used much the same code in version 4 and version 5 code and it's working for me. That implies your ComponentManager isn't coming in correctly, but there's no way to debug that from here. Where are you doing this? Plugin? Somewhere else? What else can you extract from the ComponentManager? Anything at all?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the problem is with the ComponentManager. Whatever i try to call from that Instance throws NullPointerException. Im using atlassian-jira4.2.jar file to import all these classes (ComponentManager,IssueLink etc). Im stuck. Can you please tell me which is the right jar to import all classes required for IssueLinking...?? Thank you in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, atlassian-jira4.2 jar is fine. That is where it should come from. But I don't see why the error comes there.
Can you provide us the full stacktrace?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using SOAP API? !
You can't access ComponentManager in SOAP API. Linking is not possible via SOAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We need a lot more than that, you already told us you're getting an error.
For the third time, tell us where you are doing this? Plugin?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exception in thread "main" <u>java.lang.NullPointerException</u>
at com.atlassian.jira.ComponentManager.getComponentInstanceOfType(ComponentManager.java:451)
at com.mmi.firebirdodartsync.IssueDuplicate.main(IssueDuplicate.java:53)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Arg. How to NOT answer a direct question.
SOAP implies that you're writing an external program, rather than a plugin, but that still might not be the case. One last time, before I get really angry. Where are you doing this? Plugin? External program that uses SOAP? SOAP calls extending Jira?
Give us an overview of the structure too please, and a rough idea of what you're trying to do (on a human level - e.g. "as a user of the text editor called Flibble, I want to see Jira issues expanded to URLs as I type them in"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What are you trying to do (same what Nic asked) :)
Is it remote or within JIRA itself?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, via the Jira API, internally. Write a plugin or amend the core code.
Maybe if you could tell us what you are trying to do, we could give you options and pointers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Im trying to write a java code to access Jira from Remote using SOAP API and link 2 existing issues. I have created a SOAPSession and retrieved the RemoteIssues from Jira. But cannot link those 2 issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you want an external program to link two issues in the same Jira? Is that the right description of your goal?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, linking is not supported via remote APIs. You can write your own SOAP methods for it and then use them.
See https://developer.atlassian.com/display/JIRADEV/RPC+Endpoint+Plugin+Module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok.
You can't do this via SOAP, you will need to extend SOAP to expose the functions you need, as Jobin has said.
I can't help but point out that if you'd answered the questions asked of you when they were asked, you wouldn't have wasted a load of time getting here.
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.
Just to add on, that is not available in JIRA 4.2 though. Once you are on JIRA5, you can use the method Dieter pointed to you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it's the wrong call. For Jira 4.x, I have
IssueLinkManager issueLinkManager = ComponentManager.getInstance().getIssueLinkManager()
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.