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

The import com.atlassian.jira.issue.index.DefaultIndexManager cannot be resolved

aloks April 23, 2014

I want to instantiate DefaultIndexManager,

import com.atlassian.jira.issue.index.DefaultIndexManager;

private static IssueIndexManager indexMgr = new DefaultIndexManager();

But I am getting "The import com.atlassian.jira.issue.index.DefaultIndexManager cannot be resolved".

I have also added

<dependency>

<groupId>com.atlassian.jira</groupId>

<artifactId>jira-api</artifactId>

<version>${jira.version}</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>com.atlassian.jira</groupId>

<artifactId>jira-core</artifactId>

<version>${jira.version}</version>

<scope>provided</scope>

</dependency>

in my pom.xml. Please suggest what I am missing

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2014

You should get IssueIndexManager instance through com.atlassian.jira.component.ComponentAccessor or through injection.

Why do you need to instantiate it yourself ?

aloks April 23, 2014

I am trying to reindex wll the issues of a specific project.

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2014

Are you trying to do this from a plugin or this is some java class outside of the JIRA container?

Here's a plugin code sample:

try {
				Project p = ComponentAccessor.getProjectManager().getProjectObjByKey("sample");
				IssueManager issueManager = ComponentAccessor.getIssueManager();
				Collection&lt;Long&gt; issueIdsForProject = issueManager.getIssueIdsForProject(p.getId());
				List&lt;Issue&gt; issueObjects = issueManager.getIssueObjects(issueIdsForProject);
				ComponentAccessor.getIssueIndexManager().reIndexIssueObjects(issueObjects);
			} catch (IndexException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (GenericEntityException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

aloks April 23, 2014

Yes I am trying to do this through a plugin . Thanks for the code snippet as the Component Manager is already deprecated and instead of using DefaultIndexManager , I can actually use Component Accessor.

TAGS
AUG Leaders

Atlassian Community Events