#jira #atlassian #rest


Access tickets on a remote Jira instance

17 releases (4 stable)

1.3.0 Jul 3, 2023
1.1.0 Feb 12, 2023
0.7.6 Aug 9, 2022
0.7.4 Jul 26, 2022

#2 in #atlassian

Download history 26/week @ 2023-06-09 10/week @ 2023-06-16 49/week @ 2023-06-23 80/week @ 2023-06-30 11/week @ 2023-07-07 16/week @ 2023-07-14 17/week @ 2023-07-21 45/week @ 2023-07-28 35/week @ 2023-08-04 30/week @ 2023-08-11 31/week @ 2023-08-18 40/week @ 2023-08-25 39/week @ 2023-09-01 84/week @ 2023-09-08 8/week @ 2023-09-15 7/week @ 2023-09-22

147 downloads per month
Used in acorns


536 lines


Crates.io Apache-2.0 license Documentation

CI tests Dependency status

Access issues on a remote Jira instance.


The jira_query crate is a Rust library that can query a Jira instance using its REST API. It returns a strongly typed representation of the requested issues.

This library provides no functionality to create or modify issues. The access is read-only.


Basic anonymous query

Without logging in, search for a single ticket and check for its priority:

use tokio;
use jira_query::JiraInstance;

async fn main() -> Result<(), Box<dyn Error>> {
    let jira = JiraInstance::at("https://issues.redhat.com".to_string())?;

    let issue = jira.issue("CS-1113").await?;

    assert_eq!(issue.fields.priority.name, "Normal");


Advanced query

Use an API key to log into Jira. Search for all CentOS Stream tickets that are of the Blocker priority. Check that there is more than one ticket:

use tokio;
use jira_query::{Auth, JiraInstance, Pagination};

async fn main() -> Result<(), Box<dyn Error>> {
    let jira = JiraInstance::at("https://bugzilla.redhat.com".to_string())?
        .authenticate(Auth::ApiKey("My API Key".to_string()))

    let query = r#"project="CentOS Stream" AND priority=Blocker"#;

    let issues = jira.search(query).await?;

    assert!(issues.len() > 1);


A note on semantic versioning

This crate reserves the right to make limited breaking changes to the Jira structs in minor versions (X.Y).

The reason is that the official Jira documentation does not specify which fields in the JSON body are optional (Option<T>) and which are mandatory (T). Rather than exposing all fields as optional, this crate tries to process fields as mandatory until proven otherwise in testing. As a consequence, minor releases must occasionally turn a mandatory field to an optional field.

See also


~279K SLoC