Skip to main content

Issues

Struct Issues 

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

Issue options

Implementations§

Source§

impl Issues

Source

pub fn new(jira: &Jira) -> Issues

Source

pub fn get<I>(&self, id: I) -> Result<Issue>
where I: Into<String>,

Get a single issue

See this jira docs for more information

Source

pub fn get_with_options<I>( &self, id: I, options: &IssueGetOptions, ) -> Result<Issue>
where I: Into<String>,

Get a single issue with custom options

This method allows you to specify which fields to retrieve, what to expand, and other options.

§Examples
use gouqi::{Jira, Credentials};
use gouqi::issues::IssueGetOptions;

let jira = Jira::new("https://example.atlassian.net", Credentials::Anonymous).unwrap();
let options = IssueGetOptions::builder()
    .fields(vec!["summary".to_string(), "status".to_string()])
    .expand(vec!["changelog".to_string()])
    .build();
let issue = jira.issues().get_with_options("ISSUE-123", &options).unwrap();
Source

pub fn get_custom_issue<I, D>(&self, id: I) -> Result<EditCustomIssue<D>>

Get a single custom issue

See this jira docs for more information

Source

pub fn create(&self, data: CreateIssue) -> Result<CreateResponse>

Create a new issue

See this jira docs for more information

Source

pub fn create_from_custom_issue<T: Serialize>( &self, data: CreateCustomIssue<T>, ) -> Result<CreateResponse>

Create a new custom issue

See this jira docs for more information

Source

pub fn update<I, T>(&self, id: I, data: EditIssue<T>) -> Result<()>
where I: Into<String>, T: Serialize,

Update an issue

See this jira docs for more information

Source

pub fn update_with_options<I, T>( &self, id: I, data: EditIssue<T>, options: &IssueUpdateOptions, ) -> Result<()>
where I: Into<String>, T: Serialize,

Update an issue with options

This method allows fine-grained control over the update operation, including disabling notifications, overriding security settings, and controlling response behavior.

§Examples
// Update without sending notifications
let mut fields = BTreeMap::new();
fields.insert("summary".to_string(), serde_json::Value::String("New summary".to_string()));
let edit = EditIssue { fields };

let options = IssueUpdateOptions::builder()
    .notify_users(false)
    .build();

jira.issues().update_with_options("PROJ-123", edit, &options)?;

See this jira docs for more information

Source

pub fn update_and_return<I, T>( &self, id: I, data: EditIssue<T>, options: &IssueUpdateOptions, ) -> Result<Issue>
where I: Into<String>, T: Serialize,

Update an issue and return the updated issue

This method updates an issue and returns the updated issue data in the response. This is useful when you need to see the result of the update immediately.

§Examples
// Update and get the updated issue back
let mut fields = BTreeMap::new();
fields.insert("summary".to_string(), serde_json::Value::String("Updated summary".to_string()));
let edit = EditIssue { fields };

let options = IssueUpdateOptions::builder()
    .notify_users(false)
    .return_issue(true)
    .expand(vec!["changelog".to_string()])
    .build();

let updated_issue = jira.issues().update_and_return("PROJ-123", edit, &options)?;
println!("Updated: {}", updated_issue.key);

See this jira docs for more information

Source

pub fn edit<I, T>(&self, id: I, data: EditIssue<T>) -> Result<()>
where I: Into<String>, T: Serialize,

👎Deprecated since 0.16.0:

Use update instead for consistency with REST conventions

Edit an issue

§Deprecated

Use Issues::update instead. This method will be removed in a future version.

See this jira docs for more information

Source

pub fn update_custom_issue<I, T>( &self, id: I, data: EditCustomIssue<T>, ) -> Result<()>
where I: Into<String>, T: Serialize,

Update a custom issue

See this jira docs for more information

Source

pub fn edit_custom_issue<I, T>( &self, id: I, data: EditCustomIssue<T>, ) -> Result<()>
where I: Into<String>, T: Serialize,

👎Deprecated since 0.16.0:

Use update_custom_issue instead for consistency with REST conventions

Edit a custom issue

§Deprecated

Use Issues::update_custom_issue instead. This method will be removed in a future version.

See this jira docs for more information

Source

pub fn list( &self, board: &Board, options: &SearchOptions, ) -> Result<IssueResults>

Returns a single page of issue results

See this jira docs for more information

Source

pub fn iter<'a>( &self, board: &'a Board, options: &'a SearchOptions, ) -> Result<IssuesIter<'a>>

Returns a type which may be used to iterate over consecutive pages of results

See this jira docs for more information

Source

pub fn comment<K>(&self, key: K, data: AddComment) -> Result<Comment>
where K: Into<String>,

Add a comment to an issue

Automatically detects whether to use V2 (plain text) or V3 (ADF) format based on the Jira deployment type. For Jira Cloud, uses V3/ADF format. For Server/Data Center, uses V2/plain text format.

See V2 docs and V3 docs for more information

Source

pub fn changelog<K>(&self, key: K) -> Result<Changelog>
where K: Into<String>,

Source

pub fn get_relationship_graph( &self, root_issue: &str, depth: u32, options: Option<GraphOptions>, ) -> Result<RelationshipGraph>

Extract relationship graph from Jira to specified depth

This method traverses issue relationships breadth-first starting from the root issue and builds a declarative relationship graph that can be used for analysis or applied to other Jira instances.

§Arguments
  • root_issue - The issue key to start traversal from
  • depth - Maximum depth to traverse (0 = root issue only)
  • options - Optional configuration for graph extraction
§Returns

A RelationshipGraph containing all discovered relationships

§Examples
// Get all relationships 2 levels deep from PROJ-123
let graph = jira.issues()
    .get_relationship_graph("PROJ-123", 2, None)?;

// Get only blocking relationships
use gouqi::relationships::GraphOptions;
let options = GraphOptions {
    include_types: Some(vec!["blocks".to_string(), "blocked_by".to_string()]),
    ..Default::default()
};
let blocking_graph = jira.issues()
    .get_relationship_graph("PROJ-123", 1, Some(options))?;
Source

pub fn get_bulk_relationships( &self, issue_keys: &[String], options: Option<GraphOptions>, ) -> Result<RelationshipGraph>

Get current relationships for multiple issues efficiently

This is more efficient than calling get_relationship_graph for each issue individually when you need relationships for a known set of issues.

§Arguments
  • issue_keys - List of issue keys to get relationships for
  • options - Optional configuration for relationship extraction
§Returns

A RelationshipGraph containing relationships for all specified issues

Source

pub fn delete<I>(&self, id: I) -> Result<()>
where I: Into<String>,

Delete an issue

Deletes an issue from Jira. The issue must exist and the user must have permission to delete it.

§Arguments
  • id - The issue key (e.g., “PROJ-123”) or ID
§Examples
// Delete an issue
jira.issues().delete("PROJ-123")?;
§Errors

This function will return an error if:

  • The issue does not exist
  • The user lacks permission to delete the issue
  • The issue cannot be deleted due to workflow restrictions

See this jira docs for more information

Source

pub fn delete_with_options<I>( &self, id: I, options: IssueDeleteOptions, ) -> Result<()>
where I: Into<String>,

Delete an issue with options

Deletes an issue from Jira with additional options such as deleting subtasks.

§Arguments
  • id - The issue key (e.g., “PROJ-123”) or ID
  • options - Options for the delete operation
§Examples
let jira = Jira::new("https://jira.example.com", Credentials::Basic("user".to_string(), "token".to_string()))?;
let options = IssueDeleteOptions::builder()
    .delete_subtasks(true)
    .build();
jira.issues().delete_with_options("PROJ-123", options)?;
§Errors

This function will return an error if:

  • The issue does not exist
  • The user lacks permission to delete the issue
  • The issue cannot be deleted due to workflow restrictions
§Panics

This function will panic if the issue cannot be deleted due to workflow restrictions

See this jira docs for more information

Source

pub fn archive<I>(&self, id: I) -> Result<()>
where I: Into<String>,

Archive an issue

Archives an issue in Jira. Archived issues are hidden from most views but can be restored later if needed.

§Arguments
  • id - The issue key (e.g., “PROJ-123”) or ID
§Examples
// Archive an issue
jira.issues().archive("PROJ-123")?;
§Errors

This function will return an error if:

  • The issue does not exist
  • The user lacks permission to archive the issue
  • The issue is already archived

See this jira docs for more information

Source

pub fn get_worklogs<K>(&self, issue_key: K) -> Result<WorklogList>
where K: Into<String>,

Get all worklogs for an issue

Returns a paginated list of all work logs for the specified issue.

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”) or ID
§Examples
let worklogs = jira.issues().get_worklogs("PROJ-123")?;
for worklog in worklogs.worklogs {
    println!("Worklog: {} - {}", worklog.id, worklog.time_spent.unwrap_or_default());
}
Source

pub fn get_worklog<K, W>(&self, issue_key: K, worklog_id: W) -> Result<Worklog>
where K: Into<String>, W: Into<String>,

Get a specific worklog by ID

Returns details of a specific worklog entry for an issue.

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”) or ID
  • worklog_id - The ID of the worklog
§Examples
let worklog = jira.issues().get_worklog("PROJ-123", "10001")?;
println!("Time spent: {}", worklog.time_spent.unwrap_or_default());
Source

pub fn add_worklog<K>( &self, issue_key: K, worklog: WorklogInput, ) -> Result<Worklog>
where K: Into<String>,

Add a worklog to an issue

Creates a new worklog entry for the specified issue.

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”) or ID
  • worklog - The worklog data to create
§Examples
// Log 2 hours (7200 seconds)
let worklog = WorklogInput::new(7200)
    .with_comment("Fixed the bug");

let created = jira.issues().add_worklog("PROJ-123", worklog)?;
println!("Created worklog: {}", created.id);
Source

pub fn update_worklog<K, W>( &self, issue_key: K, worklog_id: W, worklog: WorklogInput, ) -> Result<Worklog>
where K: Into<String>, W: Into<String>,

Update an existing worklog

Updates a worklog entry for the specified issue.

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”) or ID
  • worklog_id - The ID of the worklog to update
  • worklog - The updated worklog data
§Examples
let worklog = WorklogInput::new(3600)  // 1 hour
    .with_comment("Updated time estimate");

let updated = jira.issues().update_worklog("PROJ-123", "10001", worklog)?;
Source

pub fn add_worklog_with_options<K>( &self, issue_key: K, worklog: WorklogInput, options: &WorklogOptions, ) -> Result<Worklog>
where K: Into<String>,

Add a worklog with options for time tracking and notifications

This method allows you to control how the remaining estimate is adjusted when logging work, and whether to send notifications to watchers.

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”) or ID
  • worklog - The worklog data to add
  • options - Options controlling estimate adjustment and notifications
§Examples
// Log work and set a new remaining estimate
let worklog = WorklogInput::new(7200).with_comment("Implemented feature");
let options = WorklogOptions::builder()
    .adjust_estimate(AdjustEstimate::New("1d".to_string()))
    .notify_users(false)
    .build();

let created = jira.issues().add_worklog_with_options("PROJ-123", worklog, &options)?;
println!("Created worklog: {}", created.id);
Source

pub fn update_worklog_with_options<K, W>( &self, issue_key: K, worklog_id: W, worklog: WorklogInput, options: &WorklogOptions, ) -> Result<Worklog>
where K: Into<String>, W: Into<String>,

Update a worklog with options for time tracking and notifications

This method allows you to control how the remaining estimate is adjusted when updating work, and whether to send notifications to watchers.

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”) or ID
  • worklog_id - The ID of the worklog to update
  • worklog - The updated worklog data
  • options - Options controlling estimate adjustment and notifications
§Examples
// Update work and reduce the estimate by a specific amount
let worklog = WorklogInput::new(3600).with_comment("Updated time");
let options = WorklogOptions::builder()
    .adjust_estimate(AdjustEstimate::Manual("30m".to_string()))
    .notify_users(false)
    .build();

let updated = jira.issues().update_worklog_with_options("PROJ-123", "10001", worklog, &options)?;
Source

pub fn delete_worklog<K, W>(&self, issue_key: K, worklog_id: W) -> Result<()>
where K: Into<String>, W: Into<String>,

Delete a worklog

Deletes a worklog entry from an issue.

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”) or ID
  • worklog_id - The ID of the worklog to delete
§Examples
jira.issues().delete_worklog("PROJ-123", "10001")?;
Source

pub fn assign<I>(&self, id: I, assignee: Option<String>) -> Result<()>
where I: Into<String>,

Assign or unassign an issue

Assigns an issue to a specific user or unassigns it by passing None.

§Arguments
  • id - The issue key (e.g., “PROJ-123”) or ID
  • assignee - The username to assign to, or None to unassign
§Examples
// Assign an issue to a user
jira.issues().assign("PROJ-123", Some("johndoe".to_string()))?;

// Unassign an issue
jira.issues().assign("PROJ-123", None)?;
§Errors

This function will return an error if:

  • The issue does not exist
  • The user lacks permission to assign the issue
  • The specified assignee is invalid or doesn’t exist
  • The assignee cannot be assigned to issues in this project

See this jira docs for more information

Source

pub fn get_watchers<I>(&self, id: I) -> Result<Watchers>
where I: Into<String>,

Get list of users watching an issue

Returns information about all users watching the specified issue, including the total watch count and whether the current user is watching.

§Arguments
  • id - The issue key (e.g., “PROJ-123”) or ID
§Examples
let watchers = jira.issues().get_watchers("PROJ-123")?;
println!("Total watchers: {}", watchers.watch_count);
println!("I'm watching: {}", watchers.is_watching);

for watcher in &watchers.watchers {
    println!("Watcher: {}", watcher.display_name);
}

See this jira docs for more information

Source

pub fn add_watcher<I>(&self, id: I, username: String) -> Result<()>
where I: Into<String>,

Add a watcher to an issue

See this jira docs for more information

§Panics

This function will panic if the user cannot be added as a watcher

Source

pub fn remove_watcher<I>(&self, id: I, username: String) -> Result<()>
where I: Into<String>,

Remove a watcher from an issue

See this jira docs for more information

§Panics

This function will panic if the watcher cannot be removed

Source

pub fn vote<I>(&self, id: I) -> Result<()>
where I: Into<String>,

Vote for an issue

See this jira docs for more information

§Panics

This function will panic if voting fails

Source

pub fn unvote<I>(&self, id: I) -> Result<()>
where I: Into<String>,

Remove vote from an issue

See this jira docs for more information

§Panics

This function will panic if vote removal fails

Source

pub fn bulk_create( &self, issues: Vec<CreateIssue>, ) -> Result<BulkCreateResponse>

Create multiple issues in a single request

See this jira docs for more information

§Panics

This function will panic if any issue creation fails validation

Source

pub fn bulk_update( &self, updates: BulkUpdateRequest, ) -> Result<BulkUpdateResponse>

Update multiple issues in a single request

Performs bulk updates on multiple issues efficiently in a single API call. Each issue can have different fields updated.

§Arguments
  • updates - A BulkUpdateRequest containing all the issues to update
§Examples
// Update multiple issues
let mut fields1 = BTreeMap::new();
fields1.insert("summary".to_string(),
              serde_json::Value::String("New summary".to_string()));

let mut fields2 = BTreeMap::new();
fields2.insert("priority".to_string(),
              serde_json::json!({ "name": "High" }));

let request = BulkUpdateRequest {
    issue_updates: vec![
        BulkIssueUpdate {
            key: "PROJ-123".to_string(),
            fields: fields1,
        },
        BulkIssueUpdate {
            key: "PROJ-124".to_string(),
            fields: fields2,
        },
    ],
};

let response = jira.issues().bulk_update(request)?;
println!("Updated {} issues", response.issues.len());
§Errors

This function will return an error if:

  • Any of the issues don’t exist
  • The user lacks permission to update any of the issues
  • Invalid field values are provided
  • Request size exceeds Jira’s limits

See this jira docs for more information

Source

pub fn upload_attachment<I>( &self, issue_key: I, files: Vec<(&str, Vec<u8>)>, ) -> Result<Vec<AttachmentResponse>>
where I: Into<String>,

Upload one or more attachments to an issue

§Arguments
  • issue_key - The issue key (e.g., “PROJ-123”)
  • files - Vector of tuples containing (filename, file_content)
§Returns

Result<Vec<AttachmentResponse>> - Array of uploaded attachment metadata

§Examples
use gouqi::{Jira, Credentials};

let jira = Jira::new("https://example.atlassian.net", Credentials::Anonymous).unwrap();
let file_content = std::fs::read("document.pdf").unwrap();
let attachments = jira.issues()
    .upload_attachment("PROJ-123", vec![("document.pdf", file_content)])
    .unwrap();

Trait Implementations§

Source§

impl Debug for Issues

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> ErasedDestructor for T
where T: 'static,

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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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