Sample code for 30+ languages & platforms
AutoIt

Download a Jira Attachment

See more Jira Examples

Demonstrates how to download a Jira attachment to a file.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oHttp = ObjCreate("Chilkat.Http")

$oHttp.FollowRedirects = True

; Provide the username/password for authentication
$oHttp.Login = "jira@example.com"
$oHttp.Password = "JIRA_API_TOKEN"

; The URL for a Jira attachment has this format: 
; https://your-domain.atlassian.net/secure/attachment/{attachment_id}/{attachment_filename}

Local $sUrl = "https://chilkat.atlassian.net/secure/attachment/10001/starfish.jpg"
Local $sLocalFilePath = "qa_output/starfish.jpg"
$bSuccess = $oHttp.Download($sUrl,$sLocalFilePath)
If ($bSuccess <> True) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

ConsoleWrite("Successfully downloaded Jira attachment." & @CRLF)