Skip to content

Instantly share code, notes, and snippets.

@tempelmann
Created August 4, 2026 14:21
Show Gist options
  • Select an option

  • Save tempelmann/781d2752031970fcbd988ad3f23e1469 to your computer and use it in GitHub Desktop.

Select an option

Save tempelmann/781d2752031970fcbd988ad3f23e1469 to your computer and use it in GitHub Desktop.
Fetch Alassian hosted inline images for exported Bitbucket Issues

Fetch Atlassian-hosted images and other inline data from exported Bitbucket Issues.

Background / purpose

When exporting Issues from Bitbucket (which has to be done before they close it on Aug 20, 2026), the export will include attachments but will keep referencing inline images on their servers instead of downloading them.

Which means: The issues still reference images on Atlassian's servers, and there's no guarantee they won't disappear there eventually, too.

Therefore, it's prudent to download those images as well.

This script takes care of downloading these images along with updating the json file to have the image links point to their new location on your file system (in a dir called "content_files").

Preparation: Get the cookie for accessing the files on the Atlassian server:

Using a browser, log into Bitbucket, make sure you can read Issues.

Then use the browser's developer mode and find the "cloud.session.token" cookie, and copy its values into cookie.txt. (In Safari, open with cmd-option-I, switch to the "Storage" tab, look in the Cookies list for the cookie.)

How to use

cd into the dir and run:

python3 bb_fetch_links.py db-2.0.json --cookie-file cookie.txt

Notes

Remember to also export your Wiki if you used it. You can also fetch it via git (the URL is your base …/myrepo.git plus a /wiki suffix).

The script will list any such Wiki URLs as a reference.

It will rewrite the json file but keep a backup of the original one (repeat runs should not alter the files while still listing the skipped Wiki URLs and failed downloads).

Authoring

4 Aug 2026 by Thomas Tempelmann with help from Claude AI.

No rights reserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment