pub struct AtlassianClient { /* private fields */ }Expand description
HTTP client for Atlassian Cloud REST APIs.
Implementations§
Source§impl AtlassianClient
impl AtlassianClient
Sourcepub fn new(instance_url: &str, email: &str, api_token: &str) -> Result<Self>
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.
Sourcepub fn from_credentials(creds: &AtlassianCredentials) -> Result<Self>
pub fn from_credentials(creds: &AtlassianCredentials) -> Result<Self>
Creates a client from stored credentials.
Sourcepub fn instance_url(&self) -> &str
pub fn instance_url(&self) -> &str
Returns the instance URL.
Sourcepub async fn get_json(&self, url: &str) -> Result<Response>
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.
Sourcepub async fn put_json<T: Serialize + Sync + ?Sized>(
&self,
url: &str,
body: &T,
) -> Result<Response>
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.
Sourcepub async fn post_json<T: Serialize + Sync + ?Sized>(
&self,
url: &str,
body: &T,
) -> Result<Response>
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.
Sourcepub async fn get_bytes(&self, url: &str) -> Result<Vec<u8>>
pub async fn get_bytes(&self, url: &str) -> Result<Vec<u8>>
Sends an authenticated GET request and returns raw bytes.
Sourcepub async fn delete(&self, url: &str) -> Result<Response>
pub async fn delete(&self, url: &str) -> Result<Response>
Sends an authenticated DELETE request and returns the raw response.
Sourcepub async fn update_issue(
&self,
key: &str,
description_adf: &AdfDocument,
summary: Option<&str>,
) -> Result<()>
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.
Sourcepub async fn create_issue(
&self,
project_key: &str,
issue_type: &str,
summary: &str,
description_adf: Option<&AdfDocument>,
labels: &[String],
) -> Result<JiraCreatedIssue>
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.
Sourcepub async fn get_comments(&self, key: &str) -> Result<Vec<JiraComment>>
pub async fn get_comments(&self, key: &str) -> Result<Vec<JiraComment>>
Lists comments on a JIRA issue.
Sourcepub async fn add_comment(&self, key: &str, body_adf: &AdfDocument) -> Result<()>
pub async fn add_comment(&self, key: &str, body_adf: &AdfDocument) -> Result<()>
Adds a comment to a JIRA issue.
Sourcepub async fn get_transitions(&self, key: &str) -> Result<Vec<JiraTransition>>
pub async fn get_transitions(&self, key: &str) -> Result<Vec<JiraTransition>>
Lists available transitions for a JIRA issue.
Sourcepub async fn do_transition(&self, key: &str, transition_id: &str) -> Result<()>
pub async fn do_transition(&self, key: &str, transition_id: &str) -> Result<()>
Executes a transition on a JIRA issue.
Sourcepub async fn search_issues(
&self,
jql: &str,
limit: u32,
) -> Result<JiraSearchResult>
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.
Sourcepub async fn search_confluence(
&self,
cql: &str,
limit: u32,
) -> Result<ConfluenceSearchResults>
pub async fn search_confluence( &self, cql: &str, limit: u32, ) -> Result<ConfluenceSearchResults>
Searches Confluence pages using CQL with auto-pagination.
Sourcepub async fn get_boards(
&self,
project: Option<&str>,
board_type: Option<&str>,
limit: u32,
) -> Result<AgileBoardList>
pub async fn get_boards( &self, project: Option<&str>, board_type: Option<&str>, limit: u32, ) -> Result<AgileBoardList>
Lists agile boards with auto-pagination.
Sourcepub async fn get_board_issues(
&self,
board_id: u64,
jql: Option<&str>,
limit: u32,
) -> Result<JiraSearchResult>
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.
Sourcepub async fn get_sprints(
&self,
board_id: u64,
state: Option<&str>,
limit: u32,
) -> Result<AgileSprintList>
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.
Sourcepub async fn get_sprint_issues(
&self,
sprint_id: u64,
jql: Option<&str>,
limit: u32,
) -> Result<JiraSearchResult>
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.
Sourcepub async fn add_issues_to_sprint(
&self,
sprint_id: u64,
issue_keys: &[&str],
) -> Result<()>
pub async fn add_issues_to_sprint( &self, sprint_id: u64, issue_keys: &[&str], ) -> Result<()>
Adds issues to an agile sprint.
Sourcepub async fn get_issue_links(&self, key: &str) -> Result<Vec<JiraIssueLink>>
pub async fn get_issue_links(&self, key: &str) -> Result<Vec<JiraIssueLink>>
Lists links on a JIRA issue.
Sourcepub async fn get_link_types(&self) -> Result<Vec<JiraLinkType>>
pub async fn get_link_types(&self) -> Result<Vec<JiraLinkType>>
Lists available issue link types.
Sourcepub async fn create_issue_link(
&self,
type_name: &str,
inward_key: &str,
outward_key: &str,
) -> Result<()>
pub async fn create_issue_link( &self, type_name: &str, inward_key: &str, outward_key: &str, ) -> Result<()>
Creates a link between two JIRA issues.
Sourcepub async fn remove_issue_link(&self, link_id: &str) -> Result<()>
pub async fn remove_issue_link(&self, link_id: &str) -> Result<()>
Removes an issue link by ID.
Sourcepub async fn link_to_epic(&self, epic_key: &str, issue_key: &str) -> Result<()>
pub async fn link_to_epic(&self, epic_key: &str, issue_key: &str) -> Result<()>
Links an issue to an epic by setting the parent field.
Sourcepub async fn get_attachments(&self, key: &str) -> Result<Vec<JiraAttachment>>
pub async fn get_attachments(&self, key: &str) -> Result<Vec<JiraAttachment>>
Gets attachment metadata for a JIRA issue.
Sourcepub async fn get_changelog(
&self,
key: &str,
limit: u32,
) -> Result<Vec<JiraChangelogEntry>>
pub async fn get_changelog( &self, key: &str, limit: u32, ) -> Result<Vec<JiraChangelogEntry>>
Gets the changelog for a JIRA issue with auto-pagination.
Sourcepub async fn get_fields(&self) -> Result<Vec<JiraField>>
pub async fn get_fields(&self) -> Result<Vec<JiraField>>
Lists all JIRA field definitions.
Sourcepub async fn get_field_contexts(&self, field_id: &str) -> Result<Vec<String>>
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.
Sourcepub async fn get_field_options(
&self,
field_id: &str,
context_id: Option<&str>,
) -> Result<Vec<JiraFieldOption>>
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.
Sourcepub async fn get_projects(&self, limit: u32) -> Result<JiraProjectList>
pub async fn get_projects(&self, limit: u32) -> Result<JiraProjectList>
Lists JIRA projects.
Sourcepub async fn delete_issue(&self, key: &str) -> Result<()>
pub async fn delete_issue(&self, key: &str) -> Result<()>
Deletes a JIRA issue.
Sourcepub async fn get_myself(&self) -> Result<JiraUser>
pub async fn get_myself(&self) -> Result<JiraUser>
Verifies authentication by fetching the current user.