Atlassian Archives - ISbyR https://isbyr.com/tag/atlassian/ Infrequent Smarts by Reshetnikov Wed, 23 Feb 2022 01:15:02 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 How to export attachments from JIRA OnDemand and JIRA Cloud https://isbyr.com/how-to-export-attachments-from-jira-ondemand/ https://isbyr.com/how-to-export-attachments-from-jira-ondemand/#comments Thu, 12 Jun 2014 06:10:28 +0000 http://isbyr.com/?p=13 At one of the customers sites we are using JIRA OnDemand (A.K.A JIRA Cloud now) to track our BSM tasks and cost estimates, which we provide for a planned piece of work and these exist in JIRA as Excel files attached to tasks. As the end of financial year is coming close here in Australia … Continue reading How to export attachments from JIRA OnDemand and JIRA Cloud

The post How to export attachments from JIRA OnDemand and JIRA Cloud appeared first on ISbyR.

]]>
At one of the customers sites we are using JIRA OnDemand (A.K.A JIRA Cloud now) to track our BSM tasks and cost estimates, which we provide for a planned piece of work and these exist in JIRA as Excel files attached to tasks.

As the end of financial year is coming close here in Australia I was asked by my manger to send him these cost estimates for the last financial year. Trying to do it manually one by one from the Web UI for a couple of them made me think that there must be a better way to accomplish that. Google search did bring a few results but they were relevant to on premisses hosted JIRA solution where you had access to the command line.  These didn’t suit me. So after playing around a little I came up with the solution described below. If you have a Linux machine (and a know how) you could probably achieve that in a couple of lines but I only had access to my Windows machine at that time . In addition to a Windows machine  you will need  Notepad++.

Export JIRA backup

  • In the JIRA OnDemand interface navigate to JIRA Administration > System
    JIRA_Administration
  • Under the Import and Export click Backup manager
    JIRA_ImportExport.jpg
  • On the Backup manager page verify that Back up attachments is checked and click Create Backup
    JIRA_BackupManager_Before
  • Once the backup is done a link to download the backup archive will be visible.
  • Download the file and unzip it to a temporary folder (I’ve used C:\Temp).JIRA_BackupManager_After



Extracting attachments’ file names

  • Open the  C:\Temp\JIRA-backup-20140605\entities.xml  with Notepad++
  • Search the file for all the lines that have following text: FileAttachment
  • JIRA_NP_Find
  • The result will be shown in the “Find result” pane
  • JIRA_NP_Find_Result
  • Open a new file in Notepad++ and copy all the content from “Find result” pane
  • Run the following replace:
    .+id=”(\d+)”.+filename=(“.+?”).+
    ren \1 \2
  • JIRA_NP_Replace
  • As a result you will have somthing simmilar to the below:
  • JIRA_NP_REN
  • Remove all the lines that don’t start with “ren”



Copy files from all subfolders to a single folder

  • The attachments are located in the <BACKUP_ARCHIVE_FILE>\data\attachments folder (in our case it’s C:\temp\JIRA-backup-20140605\data\attachments)
  • Open a command prompt:
  • Change current directory to the attachments one
    cd C:\temp\JIRA-backup-20140605\data\attachments
    Note: if you are interested only in attachments from a specific project then type cd C:\temp\JIRA-backup-20140605\data\attachments\<PROJECT_NAME> instead of the above.
  • Create an output folder (if you are interested only in attachments from a specific project
    md c:\temp\JIraAttachments\
  • Copy files form all the projects into the output folder
    for /R %b in (.) do @copy %b\*.* c:\temp\JIraAttachments\
  • Change the current directory to the output directory
    cd c:\Temp\JIraAttchments
  • Rename the files (just copy and paste the content of the text file from Notepad++
    ren 10601 “Cost Estimation 1.xlsx”
    ren 10303 “ALM Cost Calculator.xlsx”
    ren 10304 “App Instrumentation – BPE.pptx”
    ren 10604 “BPE Approval.msg”
    ………….
  • The result is that you have all the attachments in one folder. By the way the attributes (like Date Modified) are kept
    JIRA_Result



The post How to export attachments from JIRA OnDemand and JIRA Cloud appeared first on ISbyR.

]]>
https://isbyr.com/how-to-export-attachments-from-jira-ondemand/feed/ 23