How to export Jira Align On-Premise logs to a zip file using Powershell - copy method

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This article provides a PowerShell script to export Jira Align on-prem logs to a zip file. This can be used to collect and share Jira Align logs.

This script uses a "copy-then-zip" method to avoid potential conflicts with Jira Align's active logging process.

Environment

Jira Align Self-Hosted

Solution

PowerShell Script

⚠️ Run the PowerShell script below as Administrator

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 $StartDate = Read-Host 'Enter start date (yyyy-MM-dd)' $EndDate = Read-Host 'Enter end date (yyyy-MM-dd)' # Filter log files based on creation date $Files = Get-ChildItem -Path C:\log -File | Where-Object {$_.CreationTime -ge [DateTime]::ParseExact($StartDate,'yyyy-MM-dd',$null) -and $_.CreationTime -lt [DateTime]::ParseExact($EndDate,'yyyy-MM-dd',$null).AddDays(1)} # Create a temporary directory to store copies of the log files $TempDir = "C:\temp_logs" New-Item -ItemType Directory -Path $TempDir -Force # -Force overwrites existing temp directory # Construct the name of the output zip file $ZipFileName = "C:\log\JiraAlignLogs_$StartDate"+"_to_"+"$EndDate.zip" # Copy the filtered log files to the temporary directory foreach ($File in $Files) { Copy-Item -Path $File.FullName -Destination $TempDir } # Create the zip archive from the files in the temporary directory Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory($TempDir, $ZipFileName) # Clean up the temporary directory Remove-Item -Path $TempDir -Recurse -Force Write-Host "Zip file created: $ZipFileName"

Sample Results

  • Script output at the command line

    (Auto-migrated image: description temporarily unavailable)

  • The zip file generated by the script

    (Auto-migrated image: description temporarily unavailable)

  • The files contained in the zip file with the logs filtered by the date

    (Auto-migrated image: description temporarily unavailable)
Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.