pub struct Issues { /* private fields */ }Expand description
Issue options
Implementations§
Source§impl Issues
impl Issues
pub fn new(jira: &Jira) -> Issues
Sourcepub fn get<I>(&self, id: I) -> Result<Issue>
pub fn get<I>(&self, id: I) -> Result<Issue>
Get a single issue
See this jira docs for more information
Sourcepub fn get_with_options<I>(
&self,
id: I,
options: &IssueGetOptions,
) -> Result<Issue>
pub fn get_with_options<I>( &self, id: I, options: &IssueGetOptions, ) -> Result<Issue>
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();Sourcepub fn get_custom_issue<I, D>(&self, id: I) -> Result<EditCustomIssue<D>>
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
Sourcepub fn create(&self, data: CreateIssue) -> Result<CreateResponse>
pub fn create(&self, data: CreateIssue) -> Result<CreateResponse>
Create a new issue
See this jira docs for more information
Sourcepub fn create_from_custom_issue<T: Serialize>(
&self,
data: CreateCustomIssue<T>,
) -> Result<CreateResponse>
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
Sourcepub fn update<I, T>(&self, id: I, data: EditIssue<T>) -> Result<()>
pub fn update<I, T>(&self, id: I, data: EditIssue<T>) -> Result<()>
Update an issue
See this jira docs for more information
Sourcepub fn update_with_options<I, T>(
&self,
id: I,
data: EditIssue<T>,
options: &IssueUpdateOptions,
) -> Result<()>
pub fn update_with_options<I, T>( &self, id: I, data: EditIssue<T>, options: &IssueUpdateOptions, ) -> Result<()>
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
Sourcepub fn update_and_return<I, T>(
&self,
id: I,
data: EditIssue<T>,
options: &IssueUpdateOptions,
) -> Result<Issue>
pub fn update_and_return<I, T>( &self, id: I, data: EditIssue<T>, options: &IssueUpdateOptions, ) -> Result<Issue>
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
Sourcepub fn edit<I, T>(&self, id: I, data: EditIssue<T>) -> Result<()>
👎Deprecated since 0.16.0: Use update instead for consistency with REST conventions
pub fn edit<I, T>(&self, id: I, data: EditIssue<T>) -> Result<()>
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
Sourcepub fn update_custom_issue<I, T>(
&self,
id: I,
data: EditCustomIssue<T>,
) -> Result<()>
pub fn update_custom_issue<I, T>( &self, id: I, data: EditCustomIssue<T>, ) -> Result<()>
Update a custom issue
See this jira docs for more information
Sourcepub fn edit_custom_issue<I, T>(
&self,
id: I,
data: EditCustomIssue<T>,
) -> Result<()>
👎Deprecated since 0.16.0: Use update_custom_issue instead for consistency with REST conventions
pub fn edit_custom_issue<I, T>( &self, id: I, data: EditCustomIssue<T>, ) -> Result<()>
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
Sourcepub fn list(
&self,
board: &Board,
options: &SearchOptions,
) -> Result<IssueResults>
pub fn list( &self, board: &Board, options: &SearchOptions, ) -> Result<IssueResults>
Returns a single page of issue results
See this jira docs for more information
Sourcepub fn iter<'a>(
&self,
board: &'a Board,
options: &'a SearchOptions,
) -> Result<IssuesIter<'a>>
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
Sourcepub fn comment<K>(&self, key: K, data: AddComment) -> Result<Comment>
pub fn comment<K>(&self, key: K, data: AddComment) -> Result<Comment>
pub fn changelog<K>(&self, key: K) -> Result<Changelog>
Sourcepub fn get_relationship_graph(
&self,
root_issue: &str,
depth: u32,
options: Option<GraphOptions>,
) -> Result<RelationshipGraph>
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 fromdepth- 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))?;Sourcepub fn get_bulk_relationships(
&self,
issue_keys: &[String],
options: Option<GraphOptions>,
) -> Result<RelationshipGraph>
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 foroptions- Optional configuration for relationship extraction
§Returns
A RelationshipGraph containing relationships for all specified issues
Sourcepub fn delete<I>(&self, id: I) -> Result<()>
pub fn delete<I>(&self, id: I) -> Result<()>
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
Sourcepub fn delete_with_options<I>(
&self,
id: I,
options: IssueDeleteOptions,
) -> Result<()>
pub fn delete_with_options<I>( &self, id: I, options: IssueDeleteOptions, ) -> Result<()>
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 IDoptions- 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
Sourcepub fn archive<I>(&self, id: I) -> Result<()>
pub fn archive<I>(&self, id: I) -> Result<()>
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
Sourcepub fn get_worklogs<K>(&self, issue_key: K) -> Result<WorklogList>
pub fn get_worklogs<K>(&self, issue_key: K) -> Result<WorklogList>
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());
}Sourcepub fn get_worklog<K, W>(&self, issue_key: K, worklog_id: W) -> Result<Worklog>
pub fn get_worklog<K, W>(&self, issue_key: K, worklog_id: W) -> Result<Worklog>
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 IDworklog_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());Sourcepub fn add_worklog<K>(
&self,
issue_key: K,
worklog: WorklogInput,
) -> Result<Worklog>
pub fn add_worklog<K>( &self, issue_key: K, worklog: WorklogInput, ) -> Result<Worklog>
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 IDworklog- 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);Sourcepub fn update_worklog<K, W>(
&self,
issue_key: K,
worklog_id: W,
worklog: WorklogInput,
) -> Result<Worklog>
pub fn update_worklog<K, W>( &self, issue_key: K, worklog_id: W, worklog: WorklogInput, ) -> Result<Worklog>
Update an existing worklog
Updates a worklog entry for the specified issue.
§Arguments
issue_key- The issue key (e.g., “PROJ-123”) or IDworklog_id- The ID of the worklog to updateworklog- 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)?;Sourcepub fn add_worklog_with_options<K>(
&self,
issue_key: K,
worklog: WorklogInput,
options: &WorklogOptions,
) -> Result<Worklog>
pub fn add_worklog_with_options<K>( &self, issue_key: K, worklog: WorklogInput, options: &WorklogOptions, ) -> Result<Worklog>
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 IDworklog- The worklog data to addoptions- 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);Sourcepub fn update_worklog_with_options<K, W>(
&self,
issue_key: K,
worklog_id: W,
worklog: WorklogInput,
options: &WorklogOptions,
) -> Result<Worklog>
pub fn update_worklog_with_options<K, W>( &self, issue_key: K, worklog_id: W, worklog: WorklogInput, options: &WorklogOptions, ) -> Result<Worklog>
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 IDworklog_id- The ID of the worklog to updateworklog- The updated worklog dataoptions- 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)?;Sourcepub fn delete_worklog<K, W>(&self, issue_key: K, worklog_id: W) -> Result<()>
pub fn delete_worklog<K, W>(&self, issue_key: K, worklog_id: W) -> Result<()>
Sourcepub fn assign<I>(&self, id: I, assignee: Option<String>) -> Result<()>
pub fn assign<I>(&self, id: I, assignee: Option<String>) -> Result<()>
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 IDassignee- The username to assign to, orNoneto 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
Sourcepub fn get_watchers<I>(&self, id: I) -> Result<Watchers>
pub fn get_watchers<I>(&self, id: I) -> Result<Watchers>
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
Sourcepub fn add_watcher<I>(&self, id: I, username: String) -> Result<()>
pub fn add_watcher<I>(&self, id: I, username: String) -> Result<()>
Sourcepub fn remove_watcher<I>(&self, id: I, username: String) -> Result<()>
pub fn remove_watcher<I>(&self, id: I, username: String) -> Result<()>
Sourcepub fn bulk_create(
&self,
issues: Vec<CreateIssue>,
) -> Result<BulkCreateResponse>
pub fn bulk_create( &self, issues: Vec<CreateIssue>, ) -> Result<BulkCreateResponse>
Sourcepub fn bulk_update(
&self,
updates: BulkUpdateRequest,
) -> Result<BulkUpdateResponse>
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- ABulkUpdateRequestcontaining 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
Sourcepub fn upload_attachment<I>(
&self,
issue_key: I,
files: Vec<(&str, Vec<u8>)>,
) -> Result<Vec<AttachmentResponse>>
pub fn upload_attachment<I>( &self, issue_key: I, files: Vec<(&str, Vec<u8>)>, ) -> Result<Vec<AttachmentResponse>>
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();