Need help regarding custom importer based on JIM

SrinivasD May 24, 2014

Hi,

I have written a custom importer plugin where I have my own GUI and want to call doImport method of

public interface JiraDataImporter {

void doImport(ImporterExecutionContext importerExecutionContext);

}

where this is exposed by JIM to write our own importers.

I have injected JiraDataImporter in my service constructor and tried to call the iiraDataImporter.doImport(importerExecutionContext);

I am getting the below error when I called the above method.

java.lang.NoClassDefFoundError: com/atlassian/jira/plugins/importer/imports/importer/impl/ImporterExecutionContext

As they haven't exported the Impl package I am getting this error. Is there any way to call doImport(...) from my own class or any way to get the ImporterExecutionContext in to my class to avoid the above error.

Please help.

1 answer

0 votes
pborkowski
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.
May 25, 2014

Hi,

You are right, JIM is not exporting its *.impl packages so you cannot create ImporterExecutionContext in your plugin. JIM was design in a way that only ImporterLogsPage is able to start the import - we also recommend you to do the same. The last two pages of the importer (Logs page and Finished page) are always invoked in as the last steps of the import - they make sure that import is invoked correctly (JIRA is prepared, importer started in background thread) and closed/aborted correctly.

Although I think it's a good idea to export ImporterExecutionContext (or refactor it to already exported package), so plugin developers can use it freely. I will add that to JIM backlog, I can't make any promises, but we will try to add this to JIM which will come with JIRA 6.3.

Cheers,

Przemek

SrinivasD August 5, 2014

Hi Przemek,

Need one more help.

As I said earlier I have written custom csv importer and it works fine for all system admins from admin pages.

Now I am trying to have a link for this functionality where this can be accessed to

users like project-lead(non-sysadmins) as well. As you know that our importer is accessed by admins only.

I could able to go to till the last page i.e. BeginImport page, but when I click on it I am getting below permission violation error.

Could you please help me in resolving this issue?

http://sdevuke:2990/jira/login.jsp?permissionViolation=true&os_destination=/secure/admin/ImporterLogsPage!import.jspa?externalSystem=com.test.eets.jira-custom-csv-importer:jiraCustomCsvImporter&atl_token=BHMU-N952-WZWY-MSR2|303894606b77537a6ef72a25b0ef9f00e846ab9c|lin

Thanks,

Srinivas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events