Sample code for 30+ languages & platforms
Rust

Download a Jira Attachment

See more Jira Examples

Demonstrates how to download a Jira attachment to a file.

Chilkat Rust Downloads

Rust

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

let http = chilkat::Http::new();

http.set_follow_redirects(true);

// Provide the username/password for authentication
http.set_login("jira@example.com");
http.set_password("JIRA_API_TOKEN");

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

let url = "https://chilkat.atlassian.net/secure/attachment/10001/starfish.jpg".to_string();
let local_file_path = "qa_output/starfish.jpg".to_string();
if http.download(&url, &local_file_path).is_err() {
    println!("{}", http.last_error_text());
    return;
}

println!("Successfully downloaded Jira attachment.");