(AutoIt) Download a Jira Attachment
Demonstrates how to download a Jira attachment to a file.
; 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"
Local $bSuccess = $oHttp.Download($sUrl,$sLocalFilePath)
If ($bSuccess <> True) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Successfully downloaded Jira attachment." & @CRLF)
|