Get JIRA issue field in Crucible/Fisheye in Custom Plugin Edited

Hi,

We have a custom add on report in Crucible/Fisheye, Now I want to add one JIRA issue field in it.

So we try to use Atlassian SAL to build commnunication between Crucible/Fisheye and JIRA. But I met error as below:

My code is

ReportResource.java

private CrucibleDataAccessor crucibleData;

public ReportResource(ReviewService reviewService,
ProjectService projectService,
SearchService searchService,
ApplicationLinkService applicationLinkService)
{
this.crucibleData = new CrucibleDataAccessor(reviewService, projectService, searchService, applicationLinkService);
}

 

CrucibleDataAccessor.java

private ReviewService reviewService;
private ProjectService projectService;
private SearchService searchService;
private ApplicationLinkService applicationLinkService;
private ApplicationLink appLink;

public CrucibleDataAccessor(ReviewService reviewService,
ProjectService projectService,
SearchService searchService,
ApplicationLinkService applicationLinkService) {
this.reviewService = reviewService;
this.projectService = projectService;
this.searchService = searchService;
this.applicationLinkService = applicationLinkService;
}

 

public String createRequest(com.atlassian.sal.api.net.Request.MethodType methodType,
java.lang.String url) {

String testResponse= "";
ApplicationLinkRequest request = null;
for(ApplicationLink applicationLink: this.applicationLinkService.getApplicationLinks(JiraApplicationType.class)){
if(applicationLink.getId().get().equalsIgnoreCase("JIRA")){
appLink = applicationLink;
}
}

ApplicationLinkRequestFactory requestFactory = appLink.createAuthenticatedRequestFactory();

try {
request = requestFactory.createRequest(Request.MethodType.GET,
"https://jira-dev.XXXXXX.cc/rest/reports/latest/reviewfindings?header=true&project=ITS&startDate=08/01/2017&endDate=08/11/2017");
testResponse = request.execute();

} catch (ResponseException e) {
e.printStackTrace();
} catch (CredentialsRequiredException e) {
e.printStackTrace();
}
return testResponse;
}

 

After atlas-run, I get jar file and upload to Crucible/Fisheye, when I try to run the URL to generate report https://fisheye-dev.XXXXXX.cc/rest/reports/latest/reviewfindings?header=true&showtext=true&showkey=true&showname=true&project=DEVOPS-CR&startDate=08/01/2017&endDate=08/31/2017.

In webpage it show error message

The requested resource cannot be found.

Not Found

 

In log, it show below error 

2017-09-13 05:09:08,059 ERROR [qtp502848122-185622 ] com.atlassian.plugin.servlet.DefaultServletModuleManager DefaultServletModuleManager-getInstance - Unable to create new reference LazyLoadedFilterReference{descriptor=com.XXXX.fecru.plugins.XXXXXX-reporting:XXXXXXXXReportsRest-filter (Provides XXXXXXX Reports services.), filterConfig=com.atlassian.plugin.servlet.filter.PluginFilterConfig@439b2acc}
com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.XXXXXXX.fecru.plugins.ReportResource': Unsatisfied dependency expressed through constructor argument with index 3 of type [com.atlassian.applinks.api.ApplicationLinkService]: No qualifying bean of type [com.atlassian.applinks.api.ApplicationLinkService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.applinks.api.ApplicationLinkService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149) [atlassian-util-concurrent-3.0.0.jar:?]
at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112) [atlassian-util-concurrent-3.0.0.jar:?]
at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:447) [atlassian-plugins-servlet-4.4.0.jar:?]

 

Could you help to give some suggestion about it or please suggest how to use SAL to build connection between Crucible and JIRA.

 

Thanks, Neo

1 answer

0 vote

Did you import the ApplicationLinkService component?

src/main/resources/atlassian-plugin.xml

<component-import key="applicationLinkService">
<interface>com.atlassian.applinks.api.ApplicationLinkService</interface>
</component-import>

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

90 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you