Cannot access project entity properties during migration with JCMA

Hi,

I’m extending my app to support migration with the JCMA tool. I’ve run into a problem where my app does not have access to project entity properties when it’s

public void onStartAppMigration(String transferId, MigrationDetails migrationDetails)

method gets called.

Should it be possible to fetch project (and issue) entity properties? Or does it need changes to Jira (e.g. [MIG-312] Create a bulk API for importing entity properties - Create and track feature requests for Atlassian products.) to facilitate it?

I have code in that method which uses injected components:

@ComponentImport
private final ProjectPropertyService projectPropertyService;
@ComponentImport
private final JiraAuthenticationContext jiraAuthenticationContext;

...

ApplicationUser applicationUser = jiraAuthenticationContext.getLoggedInUser();
projectPropertyService.getProperty(applicationUser, projectKey, propertyKey);

Notably, the applicationUser is null, which presumably causes the .getProperty() call to return a permissions error:

Error Messages: [You cannot view this project.]

Regards,
Robert.

Any reason why you can’t find some admin user (though API) and impersonate it? Not saying this is what you should do, just asking if you tried and it didn’t work somehow?

1 Like