Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practice to import attachments with jiraone export file #144

Open
kalupator opened this issue Nov 30, 2024 · 8 comments
Open

Best practice to import attachments with jiraone export file #144

kalupator opened this issue Nov 30, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@kalupator
Copy link

kalupator commented Nov 30, 2024

Hello!
In the prepared by jiraone csv\json export file, links to attachments from the old jira look like this:
https://oldjira.domain.com/secure/attachment/11853/MyFile.docx

But when importing a file into a new Jira, the attachments file cannot be downloaded from the old Jira, because authentication is required in the old Jira.

I have already dealt with this before and solved this problem in the following way:
For each attachment link I added a login and password for old jira in the following way: ?os_username=USER&os_password=PWD.

For example:
https://oldjira.domain.com/secure/attachment/11853/MyFile.docx?os_username=USER&os_password=PWD

After that, when importing a file in the new Jira, attachments were downloaded from the old Jira.

I want to understand if there is any solution for jiraone when preparing the export file?
What is the best practice for importing attachments with jiraone prepared export file?
Thanks!

@princenyeche
Copy link
Owner

Hey @kalupator

To do that in jiraone for a CSV import, you have to export the Jira issues using the below argument. For example

# previous import statement
issue_export(jql=jql, extension="csv", final_file="export-test", allow_media=True)

The argument allow_media with the value True adds your credential to every media file within the CSV export of the attachment columns, so you can easily import attachment files with your exported file. I hope that helps.

@princenyeche princenyeche self-assigned this Nov 30, 2024
@princenyeche princenyeche added the question Further information is requested label Nov 30, 2024
@kalupator
Copy link
Author

Thanks for the answer! I will check it as soon as possible and write the result.

@kalupator
Copy link
Author

kalupator commented Dec 3, 2024

@princenyeche, I tried to install allow_media=True.
Now all links contain a password:
https://e:[email protected]/secure/attachment/11698/file.docx
But I get an error during import:
Error: HTTP status code: 401 Unauthorized
I think it's because the link only has a password but no user.
Or in this case the user "e"? Then where does it come from?

@princenyeche
Copy link
Owner

@kalupator I believe that's the username. If your site allows usernames, that should be how to auth it to allow attachments extracted from one site to another.

@kalupator
Copy link
Author

kalupator commented Dec 30, 2024

@princenyeche
After several experiments, I realized that it is the first letter of the username.
If i replace it with the full username in result export file, authorization does indeed occur correctly.
But for some reason jiraone always export only the first letter of the username in attachments links.
Do you know what the problem might be?

@princenyeche
Copy link
Owner

Yeah, I found the problem here. The code uses an index when it should not. I've fixed it and will push the fix in the next update.

@kalupator
Copy link
Author

kalupator commented Dec 31, 2024

@princenyeche
Great news!
And when do you plan to do next update? I'm planning a big migration of my projects after the new year holidays =)
I think it's possible to label the case as a bug?

@princenyeche princenyeche added bug Something isn't working and removed question Further information is requested labels Dec 31, 2024
@princenyeche
Copy link
Owner

I'll push it together with #122 issue since it's still there. The PR is already raised #149 just waiting to confirm the other issue is resolved then can push it together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants