Hi @StefanBombrowski,
have you tried to reconstruct the path to the attachments directory manually, leveraging Jira’s component access to relevant properties.
You can try to use the JiraHome
component to fetch Jira’s data directory and constructs the path to the attachments
directory.
import com.atlassian.jira.config.util.JiraHome;
import com.atlassian.jira.component.ComponentAccessor;
import java.nio.file.Paths;
public String getAttachmentDirectory() {
JiraHome jiraHome = ComponentAccessor.getComponent(JiraHome.class);
String attachmentsDir = Paths.get(jiraHome.getDataDirectory().getAbsolutePath(), "attachments").toString();
return attachmentsDir;
}
Chears,
Daniel