(Tcl) Download a Jira Attachment
Demonstrates how to download a Jira attachment to a file.
load ./chilkat.dll
# This example requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
set http [new_CkHttp]
CkHttp_put_FollowRedirects $http 1
# Provide the username/password for authentication
CkHttp_put_Login $http "jira@example.com"
CkHttp_put_Password $http "JIRA_API_TOKEN"
# The URL for a Jira attachment has this format:
# https://your-domain.atlassian.net/secure/attachment/{attachment_id}/{attachment_filename}
set url "https://chilkat.atlassian.net/secure/attachment/10001/starfish.jpg"
set localFilePath "qa_output/starfish.jpg"
set success [CkHttp_Download $http $url $localFilePath]
if {$success != 1} then {
puts [CkHttp_lastErrorText $http]
delete_CkHttp $http
exit
}
puts "Successfully downloaded Jira attachment."
delete_CkHttp $http
|