Sample code for 30+ languages & platforms
Tcl

Download a Jira Attachment

See more Jira Examples

Demonstrates how to download a Jira attachment to a file.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

# 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