Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,551,871
Community Members
 
Community Events
184
Community Groups

How to inject IssueBeanBuilder2 ?

Jira version: 7.13.0
Java version: 1.7
Platform: server

I need to receive SearchResultsBean to get Issues like JSON.
When I started Jira I catch the exception:

The plugin has been disabled. A likely cause is that it timed out during initialisation. It has the following missing service dependencies : &issueBeanBuilder2 of type(&(objectClass=com.atlassian.jira.rest.v2.issue.IssueBeanBuilder2)(objectClass=com.atlassian.jira.rest.v2.issue.IssueBeanBuilder2))

 

my service:

@Named
@ExportAsService({IIssueJiraService.class})
public class IssueJiraService implements IIssueJiraService {

private final IssueBeanBuilder2 issueBeanBuilder;

@Inject
public IssueJiraService(@ComponentImport IssueBeanBuilder2 issueBeanBuilder) {
this.issueBeanBuilder = issueBeanBuilder;
}

public ResultsBean getIssueBean(issue){
IssueBean issueBean = issueBeanBuilder.build(issue);
List<IssueBean> issueBeans = Arrays.asList(issueBean);
SearchResultsBean resultsBean = new SearchResultsBean(0, 1000, results.getTotal(), issueBeans);
return resultsBean;
}
}

 

my pom (only dependency for IssueBeanBuilder2):

<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-plugin</artifactId>
<version>7.1.0-QR20151229171111</version>
<scope>provided</scope>
</dependency>

 

Jira docs:
https://docs.atlassian.com/software/jira/docs/api/8.1.0/com/atlassian/jira/rest/v2/search/SearchResultsBean.html
https://docs.atlassian.com/software/jira/docs/api/8.1.0/com/atlassian/jira/rest/v2/issue/IssueBean.html 

2 answers

You should be able to inject BeanBuilderFactory and then call its newIssueBeanBuilder2 method.

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 01, 2020

Hi,

I understand that you are getting a plugin disabled message when trying to start this plugin.  While I don't have much experience in terms of developing plugins for Jira, I did notice that you listed the Java version as 1.7.  The problem with that, if accurate, is that Jira 7 and higher has required Java 8 (aka 1.8) at least since Jira 7.0.x versions.  More details on this JVM requirement can be seen in the Supported platforms documentation.

If that is not the solution, then I would recommend asking within our Developer Community.  That community is technically a separate site from this one, and it is geared more towards plugin development for Atlassian products.  So perhaps you might find additional help there.

Regards,

Andy

Hi, @Andy Heinzer 

Thanks for your help
I tried to switch to java 1.8 and its not the solution. Also, I asked on Developer Community and we came to the conclusion that its impossible.
Therefore, I abandoned this approach and use java classes from Jira.

Regards,
Oleksii

Like Andy Heinzer likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events