Skip to main content

AtlassianClient

Struct AtlassianClient 

Source
pub struct AtlassianClient { /* private fields */ }
Expand description

HTTP client for Atlassian Cloud REST APIs.

Implementations§

Source§

impl AtlassianClient

Source

pub fn new(instance_url: &str, email: &str, api_token: &str) -> Result<Self>

Creates a new Atlassian API client.

Constructs the Basic Auth header from the email and API token.

Source

pub fn from_credentials(creds: &AtlassianCredentials) -> Result<Self>

Creates a client from stored credentials.

Source

pub fn instance_url(&self) -> &str

Returns the instance URL.

Source

pub async fn get_json(&self, url: &str) -> Result<Response>

Sends an authenticated GET request and returns the raw response.

Shared transport method used by both JIRA and Confluence API implementations.

Source

pub async fn put_json<T: Serialize + Sync + ?Sized>( &self, url: &str, body: &T, ) -> Result<Response>

Sends an authenticated PUT request with a JSON body and returns the raw response.

Shared transport method used by both JIRA and Confluence API implementations.

Source

pub async fn post_json<T: Serialize + Sync + ?Sized>( &self, url: &str, body: &T, ) -> Result<Response>

Sends an authenticated POST request with a JSON body and returns the raw response.

Source

pub async fn get_bytes(&self, url: &str) -> Result<Vec<u8>>

Sends an authenticated GET request and returns raw bytes.

Source

pub async fn delete(&self, url: &str) -> Result<Response>

Sends an authenticated DELETE request and returns the raw response.

Source

pub async fn get_issue(&self, key: &str) -> Result<JiraIssue>

Fetches a JIRA issue by key.

Source

pub async fn update_issue( &self, key: &str, description_adf: &AdfDocument, summary: Option<&str>, ) -> Result<()>

Updates a JIRA issue’s description and optionally its summary.

Source

pub async fn create_issue( &self, project_key: &str, issue_type: &str, summary: &str, description_adf: Option<&AdfDocument>, labels: &[String], ) -> Result<JiraCreatedIssue>

Creates a new JIRA issue.

Source

pub async fn get_comments( &self, key: &str, limit: u32, ) -> Result<Vec<JiraComment>>

Lists comments on a JIRA issue with auto-pagination.

limit caps the total number of comments returned. Pass 0 for unlimited.

Source

pub async fn add_comment(&self, key: &str, body_adf: &AdfDocument) -> Result<()>

Adds a comment to a JIRA issue.

Source

pub async fn get_worklogs( &self, key: &str, limit: u32, ) -> Result<JiraWorklogList>

Lists worklogs for a JIRA issue.

Source

pub async fn add_worklog( &self, key: &str, time_spent: &str, started: Option<&str>, comment: Option<&str>, ) -> Result<()>

Adds a worklog entry to a JIRA issue.

Source

pub async fn get_transitions(&self, key: &str) -> Result<Vec<JiraTransition>>

Lists available transitions for a JIRA issue.

Source

pub async fn do_transition(&self, key: &str, transition_id: &str) -> Result<()>

Executes a transition on a JIRA issue.

Source

pub async fn search_issues( &self, jql: &str, limit: u32, ) -> Result<JiraSearchResult>

Searches JIRA issues using JQL with auto-pagination.

limit controls total results: 0 means unlimited.

Source

pub async fn search_confluence( &self, cql: &str, limit: u32, ) -> Result<ConfluenceSearchResults>

Searches Confluence pages using CQL with auto-pagination.

Source

pub async fn search_confluence_users( &self, query: &str, limit: u32, ) -> Result<ConfluenceUserSearchResults>

Searches Confluence users by display name or email.

Source

pub async fn get_boards( &self, project: Option<&str>, board_type: Option<&str>, limit: u32, ) -> Result<AgileBoardList>

Lists agile boards with auto-pagination.

Source

pub async fn get_board_issues( &self, board_id: u64, jql: Option<&str>, limit: u32, ) -> Result<JiraSearchResult>

Lists issues on an agile board with auto-pagination.

Source

pub async fn get_sprints( &self, board_id: u64, state: Option<&str>, limit: u32, ) -> Result<AgileSprintList>

Lists sprints for an agile board with auto-pagination.

Source

pub async fn get_sprint_issues( &self, sprint_id: u64, jql: Option<&str>, limit: u32, ) -> Result<JiraSearchResult>

Lists issues in an agile sprint with auto-pagination.

Source

pub async fn add_issues_to_sprint( &self, sprint_id: u64, issue_keys: &[&str], ) -> Result<()>

Adds issues to an agile sprint.

Source

pub async fn create_sprint( &self, board_id: u64, name: &str, start_date: Option<&str>, end_date: Option<&str>, goal: Option<&str>, ) -> Result<AgileSprint>

Creates a new sprint on an agile board.

Source

pub async fn update_sprint( &self, sprint_id: u64, name: Option<&str>, state: Option<&str>, start_date: Option<&str>, end_date: Option<&str>, goal: Option<&str>, ) -> Result<()>

Updates an existing sprint.

Lists links on a JIRA issue.

Lists available issue link types.

Creates a link between two JIRA issues.

Removes an issue link by ID.

Links an issue to an epic by setting the parent field.

Source

pub async fn get_issue_id(&self, key: &str) -> Result<String>

Resolves a JIRA issue key to its numeric ID.

Source

pub async fn get_dev_status_summary( &self, key: &str, ) -> Result<JiraDevStatusSummary>

Fetches a development status summary (counts per category) for a JIRA issue.

Uses the DevStatus summary endpoint. Returns counts and provider names for each category (pull requests, branches, repositories).

Source

pub async fn get_dev_status( &self, key: &str, data_type: Option<&str>, application_type: Option<&str>, ) -> Result<JiraDevStatus>

Fetches development status (PRs, branches, repositories) for a JIRA issue.

Uses the DevStatus API which requires the numeric issue ID. The key is resolved automatically via get_issue_id.

If application_type is None, discovers available providers via the summary endpoint and queries each one. If Some, queries only that provider (e.g., “GitHub”, “bitbucket”, “stash”).

Source

pub async fn get_attachments(&self, key: &str) -> Result<Vec<JiraAttachment>>

Gets attachment metadata for a JIRA issue.

Source

pub async fn get_changelog( &self, key: &str, limit: u32, ) -> Result<Vec<JiraChangelogEntry>>

Gets the changelog for a JIRA issue with auto-pagination.

Source

pub async fn get_fields(&self) -> Result<Vec<JiraField>>

Lists all JIRA field definitions.

Source

pub async fn get_field_contexts(&self, field_id: &str) -> Result<Vec<String>>

Lists options for a JIRA custom field. Lists contexts for a JIRA custom field.

Source

pub async fn get_field_options( &self, field_id: &str, context_id: Option<&str>, ) -> Result<Vec<JiraFieldOption>>

Lists options for a JIRA custom field.

When context_id is None, auto-discovers the first context for the field.

Source

pub async fn get_projects(&self, limit: u32) -> Result<JiraProjectList>

Lists JIRA projects.

Source

pub async fn delete_issue(&self, key: &str) -> Result<()>

Deletes a JIRA issue.

Source

pub async fn get_watchers(&self, key: &str) -> Result<JiraWatcherList>

Lists watchers on a JIRA issue.

Source

pub async fn add_watcher(&self, key: &str, account_id: &str) -> Result<()>

Adds a user as a watcher on a JIRA issue.

Source

pub async fn remove_watcher(&self, key: &str, account_id: &str) -> Result<()>

Removes a user from watchers on a JIRA issue.

Source

pub async fn get_myself(&self) -> Result<JiraUser>

Verifies authentication by fetching the current user.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more