pub struct JiraClient { /* private fields */ }Implementations§
Source§impl JiraClient
impl JiraClient
pub fn new( host: &str, email: &str, token: &str, auth_type: AuthType, api_version: u8, ) -> Result<Self, ApiError>
pub fn host(&self) -> &str
pub fn api_version(&self) -> u8
pub fn browse_base_url(&self) -> &str
pub fn browse_url(&self, issue_key: &str) -> String
Sourcepub async fn search(
&self,
jql: &str,
max_results: usize,
start_at: usize,
) -> Result<SearchResponse, ApiError>
pub async fn search( &self, jql: &str, max_results: usize, start_at: usize, ) -> Result<SearchResponse, ApiError>
Search issues using JQL.
Sourcepub async fn get_issue(&self, key: &str) -> Result<Issue, ApiError>
pub async fn get_issue(&self, key: &str) -> Result<Issue, ApiError>
Fetch a single issue by key (e.g. PROJ-123), including all comments.
Jira embeds only the first page of comments in the issue response. When the embedded page is incomplete, additional requests are made to fetch the remaining comments.
Sourcepub async fn create_issue(
&self,
project_key: &str,
issue_type: &str,
summary: &str,
description: Option<&str>,
priority: Option<&str>,
labels: Option<&[&str]>,
assignee: Option<&str>,
custom_fields: &[(String, Value)],
) -> Result<CreateIssueResponse, ApiError>
pub async fn create_issue( &self, project_key: &str, issue_type: &str, summary: &str, description: Option<&str>, priority: Option<&str>, labels: Option<&[&str]>, assignee: Option<&str>, custom_fields: &[(String, Value)], ) -> Result<CreateIssueResponse, ApiError>
Create a new issue.
Sourcepub async fn add_comment(
&self,
key: &str,
body: &str,
) -> Result<Comment, ApiError>
pub async fn add_comment( &self, key: &str, body: &str, ) -> Result<Comment, ApiError>
Add a comment to an issue.
Sourcepub async fn get_transitions(
&self,
key: &str,
) -> Result<Vec<Transition>, ApiError>
pub async fn get_transitions( &self, key: &str, ) -> Result<Vec<Transition>, ApiError>
List available transitions for an issue.
Sourcepub async fn do_transition(
&self,
key: &str,
transition_id: &str,
) -> Result<(), ApiError>
pub async fn do_transition( &self, key: &str, transition_id: &str, ) -> Result<(), ApiError>
Execute a transition by transition ID.
Sourcepub async fn assign_issue(
&self,
key: &str,
account_id: Option<&str>,
) -> Result<(), ApiError>
pub async fn assign_issue( &self, key: &str, account_id: Option<&str>, ) -> Result<(), ApiError>
Assign an issue to a user, or unassign with None.
API v3 (Jira Cloud) identifies users by accountId.
API v2 (Jira Data Center / Server) identifies users by name (username).
Sourcepub async fn get_myself(&self) -> Result<Myself, ApiError>
pub async fn get_myself(&self) -> Result<Myself, ApiError>
Get the currently authenticated user.
Sourcepub async fn update_issue(
&self,
key: &str,
summary: Option<&str>,
description: Option<&str>,
priority: Option<&str>,
custom_fields: &[(String, Value)],
) -> Result<(), ApiError>
pub async fn update_issue( &self, key: &str, summary: Option<&str>, description: Option<&str>, priority: Option<&str>, custom_fields: &[(String, Value)], ) -> Result<(), ApiError>
Update issue fields (summary, description, priority, or any custom field).
Sourcepub async fn search_users(&self, query: &str) -> Result<Vec<User>, ApiError>
pub async fn search_users(&self, query: &str) -> Result<Vec<User>, ApiError>
Search for users matching a query string.
API v2: uses username parameter. API v3: uses query parameter.
Sourcepub async fn get_link_types(&self) -> Result<Vec<IssueLinkType>, ApiError>
pub async fn get_link_types(&self) -> Result<Vec<IssueLinkType>, ApiError>
List available issue link types.
Sourcepub async fn link_issues(
&self,
from_key: &str,
to_key: &str,
link_type: &str,
) -> Result<(), ApiError>
pub async fn link_issues( &self, from_key: &str, to_key: &str, link_type: &str, ) -> Result<(), ApiError>
Link two issues.
link_type is the name of the link type (e.g. “Blocks”, “Duplicate”).
The direction follows the link type’s outward description:
from_key outward-links to to_key.
Sourcepub async fn unlink_issues(&self, link_id: &str) -> Result<(), ApiError>
pub async fn unlink_issues(&self, link_id: &str) -> Result<(), ApiError>
Remove an issue link by its ID.
Sourcepub async fn list_boards(&self) -> Result<Vec<Board>, ApiError>
pub async fn list_boards(&self) -> Result<Vec<Board>, ApiError>
List all boards, fetching all pages.
Sourcepub async fn list_sprints(
&self,
board_id: u64,
state: Option<&str>,
) -> Result<Vec<Sprint>, ApiError>
pub async fn list_sprints( &self, board_id: u64, state: Option<&str>, ) -> Result<Vec<Sprint>, ApiError>
List sprints for a board, optionally filtered by state.
state can be “active”, “closed”, “future”, or None for all.
Sourcepub async fn list_projects(&self) -> Result<Vec<Project>, ApiError>
pub async fn list_projects(&self) -> Result<Vec<Project>, ApiError>
List all accessible projects.
API v3 (Jira Cloud) uses the paginated project/search endpoint.
API v2 (Jira Data Center / Server) uses the simpler project endpoint
that returns all results in a single flat array.
Sourcepub async fn get_project(&self, key: &str) -> Result<Project, ApiError>
pub async fn get_project(&self, key: &str) -> Result<Project, ApiError>
Fetch a single project by key.
Sourcepub async fn list_fields(&self) -> Result<Vec<Field>, ApiError>
pub async fn list_fields(&self) -> Result<Vec<Field>, ApiError>
List all available fields (system and custom).
Sourcepub async fn move_issue_to_sprint(
&self,
issue_key: &str,
sprint_id: u64,
) -> Result<(), ApiError>
pub async fn move_issue_to_sprint( &self, issue_key: &str, sprint_id: u64, ) -> Result<(), ApiError>
Move an issue to a sprint.
Uses the Agile REST API which is version-independent.
Sourcepub async fn get_sprint(&self, sprint_id: u64) -> Result<Sprint, ApiError>
pub async fn get_sprint(&self, sprint_id: u64) -> Result<Sprint, ApiError>
Fetch a single sprint by numeric ID.
Sourcepub async fn resolve_sprint(&self, specifier: &str) -> Result<Sprint, ApiError>
pub async fn resolve_sprint(&self, specifier: &str) -> Result<Sprint, ApiError>
Resolve a sprint specifier to a Sprint.
Accepts:
- A numeric string: fetches the sprint by ID to confirm it exists and get the name
"active": returns the first active sprint found across all boards- Any other string: matched case-insensitively as a substring of sprint names
Auto Trait Implementations§
impl Freeze for JiraClient
impl !RefUnwindSafe for JiraClient
impl Send for JiraClient
impl Sync for JiraClient
impl Unpin for JiraClient
impl UnsafeUnpin for JiraClient
impl !UnwindSafe for JiraClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more