Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,254,235
Community Members
 
Community Events
164
Community Groups

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 votes

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
TAGS
Community showcase
Published in Jira

#JiraHeroes May '22 Spotlight: Daniel Cave

At Atlassian, we take great pride in the software we ship, and even greater pride in the success our customers achieve when they use our products. #JiraHeroes is our new monthly spotlight series&nbsp...

469 views 0 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you