Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to attach links like github or crucible to the jira using java code?

Akash Rathore
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 31, 2019

I looked into it and found that it can be done using 

 

RemoteIssueLink link = new RemoteIssueLinkBuilder().issueId(issue.getId()).url("http://someUrl").summary("My web link").build();
	ComponentAccessor.getComponent(RemoteIssueLinkManager.class).createRemoteIssueLink(link, user);

this code but as the createRemoteIssueLink is deprecated and I am using jira-api version 7 I am not sure how to do it? 

I have found some other ways but I am getting the following exception 

 

java.lang.IllegalStateException: ComponentAccessor has not been initialised.

This is not expected to occur on a production system.
Developers that encounter this message within a unit test
should use n MockitoMocksInContainer rule to initialize mockito and ComponentAccessor.
For more detailed explanation read the documentation
for MockComponentWorker in the jira-tests artifact for more information
about what causes this error and how to address it.

 

I have looked into the questions related to this exception but nothing helped. 

So, the question is how to create remote links using java in the newer versions?

0 answers

Suggest an answer

Log in or Sign up to answer