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

Attachment Path Problem

DupontD October 19, 2016

Hello,

We are trying to migrate from JIRA 6.4.1 to JIRA Core 7.2.3 and we have a problem with attachments.

 

In JIRA's configuration page, attachments path is : /data/jira/data/attachments

We can create attachments in JIRA GUI ... but attachments are stored in /data/jira/data/attachments/PROJECT_KEY/x0000/ISSUE_KEY/ID instead of /data/jira/data/attachments/PROJECT_KEY/ISSUE_KEY/ID

x0000 : 10000 for project 1

x0000 : 20000 for project 2

 

In Groovy :

filePath = PathUtils.joinPaths(pathManager.attachmentPath, event.issue.projectObject.key, event.issue.key, attachment.id.toString())

 

Filepath is : /data/jira/data/attachments/PROJECT_KEY/ISSUE_KEY/ID

but after ...

 

atFile = new File(filePath)

if (atFile.exists())

...

 

atFile doesn't exist (normal) ...

 

This JIRA 7.2.3 plateform is a test migration plateform (not our production) so i am not sure if it's a migration 6.4 to 7.2 issue.

Does anyone have an explanation why the path is .../x0000/ ... on my filesystem ?

Thanks

 

Same problem here : https://answers.atlassian.com/questions/39995607

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jérôme Le Maguet October 27, 2016

From Atlassian Support :

"The directory x0000 is created with every increment of 10,000 issues."

 

Explanation here :

http://blog.valiantys.com/en/jira-en/million-jira-issues

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 19, 2016

That's right, it has changed.  It's because project keys are now mutable, so you can't rely on a project retaining the same key.  The x0000 is the id of the project, which is immutable.

You can simply rename the directories when you migrate/move, but if you upgrade in place, it'll handle it for you.

DupontD October 19, 2016

The x0000 is the id of the project, which is immutable.

Thanks for your reply but ... are you sure ?

Project Id in database (and in groovy with : issue.projectObject.id) is 10001

The attachment path is : /data/jira/data/attachments/PROJECT_KEY/20000/ISSUE_KEY/xxx

I don't have a project with id = 20000.

 

I use a groovy script in post function "Create Issue" to duplicate and rename attachments with :

attachmentManager.createAttachmentCopySourceFile(...)

so i need to know the correct attachment path.

An example here : https://answers.atlassian.com/questions/139428

TAGS
AUG Leaders

Atlassian Community Events