pub struct WorkItemsClient<'a> { /* private fields */ }Implementations§
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn get_with_options(
&self,
id: i64,
options: &GetWorkItemOptions,
) -> Result<WorkItem>
pub async fn get_with_options( &self, id: i64, options: &GetWorkItemOptions, ) -> Result<WorkItem>
Get a single work item with extended options.
§Arguments
id— The work item ID.options—GetWorkItemOptionsfor field selection, expansion, as-of date, etc.
§Returns
The WorkItem with requested fields and expansions.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn get_many_with_options(
&self,
ids: &[i64],
options: &GetWorkItemOptions,
) -> Result<Vec<WorkItem>>
pub async fn get_many_with_options( &self, ids: &[i64], options: &GetWorkItemOptions, ) -> Result<Vec<WorkItem>>
Get multiple work items with extended options.
§Arguments
ids— A slice of work item IDs to fetch.options—GetWorkItemOptionsfor field selection, expansion, etc.
§Returns
A Vec<WorkItem> with the requested options applied.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn get_batch(
&self,
request: &WorkItemBatchGetRequest,
) -> Result<Vec<WorkItem>>
pub async fn get_batch( &self, request: &WorkItemBatchGetRequest, ) -> Result<Vec<WorkItem>>
Get work items using a batch request with full filtering control.
§Arguments
request— AWorkItemBatchGetRequestspecifying IDs, fields, expansion level, as-of date, and error policy.
§Returns
A Vec<WorkItem> matching the batch criteria.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn create(
&self,
project: &str,
work_item_type: &str,
patch_document: &[JsonPatchOperation],
) -> Result<WorkItem>
pub async fn create( &self, project: &str, work_item_type: &str, patch_document: &[JsonPatchOperation], ) -> Result<WorkItem>
Create a new work item.
§Arguments
project— The project name where the work item will be created.work_item_type— The work item type (e.g.,"Bug","Task","User Story").patch_document— A slice ofJsonPatchOperationdescribing the fields to set. UseJsonPatchOperation::add()to build operations.
§Returns
The newly created WorkItem.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn create_with_options(
&self,
project: &str,
work_item_type: &str,
patch_document: &[JsonPatchOperation],
options: &CreateWorkItemOptions,
) -> Result<WorkItem>
pub async fn create_with_options( &self, project: &str, work_item_type: &str, patch_document: &[JsonPatchOperation], options: &CreateWorkItemOptions, ) -> Result<WorkItem>
Create a new work item with additional options.
§Arguments
project— The project name.work_item_type— The work item type (e.g.,"Bug").patch_document— A slice ofJsonPatchOperationdescribing the fields.options—CreateWorkItemOptionsfor validation, rule bypass, and notifications.
§Returns
The newly created WorkItem.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn update(
&self,
id: i64,
patch_document: &[JsonPatchOperation],
) -> Result<WorkItem>
pub async fn update( &self, id: i64, patch_document: &[JsonPatchOperation], ) -> Result<WorkItem>
Update an existing work item.
§Arguments
id— The work item ID to update.patch_document— A slice ofJsonPatchOperationdescribing the fields to modify. UseJsonPatchOperation::replace()orJsonPatchOperation::add()to build operations.
§Returns
The updated WorkItem.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn update_with_options(
&self,
id: i64,
patch_document: &[JsonPatchOperation],
options: &UpdateWorkItemOptions,
) -> Result<WorkItem>
pub async fn update_with_options( &self, id: i64, patch_document: &[JsonPatchOperation], options: &UpdateWorkItemOptions, ) -> Result<WorkItem>
Update an existing work item with additional options.
§Arguments
id— The work item ID to update.patch_document— A slice ofJsonPatchOperationdescribing the fields to modify.options—UpdateWorkItemOptionsfor validation, rule bypass, and notifications.
§Returns
The updated WorkItem.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn delete(&self, id: i64) -> Result<WorkItemDelete>
pub async fn delete(&self, id: i64) -> Result<WorkItemDelete>
Move a work item to the recycle bin (soft delete).
§Arguments
id— The work item ID to delete.
§Returns
A WorkItemDelete describing the deleted work item.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn destroy(&self, id: i64) -> Result<WorkItemDelete>
pub async fn destroy(&self, id: i64) -> Result<WorkItemDelete>
Permanently destroy a work item (bypasses the recycle bin).
§Arguments
id— The work item ID to permanently delete.
§Returns
A WorkItemDelete confirming the permanent deletion.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn query_by_wiql(
&self,
project: &str,
wiql: &Wiql,
) -> Result<WorkItemQueryResult>
pub async fn query_by_wiql( &self, project: &str, wiql: &Wiql, ) -> Result<WorkItemQueryResult>
Execute a WIQL (Work Item Query Language) query.
§Arguments
project— The project name to scope the query to.wiql— AWiqlobject containing the WIQL query string.
§Returns
A WorkItemQueryResult with matching work item references.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn query_by_wiql_for_team(
&self,
project: &str,
team: &str,
wiql: &Wiql,
) -> Result<WorkItemQueryResult>
pub async fn query_by_wiql_for_team( &self, project: &str, team: &str, wiql: &Wiql, ) -> Result<WorkItemQueryResult>
Execute a WIQL query scoped to a specific team.
§Arguments
project— The project name.team— The team name within the project.wiql— AWiqlobject containing the WIQL query string.
§Returns
A WorkItemQueryResult scoped to the team’s area path.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn query_by_id(
&self,
project: &str,
query_id: &str,
) -> Result<WorkItemQueryResult>
pub async fn query_by_id( &self, project: &str, query_id: &str, ) -> Result<WorkItemQueryResult>
Execute a saved query by its ID.
§Arguments
project— The project name.query_id— The GUID of the saved query.
§Returns
A WorkItemQueryResult from executing the saved query.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn query_by_id_for_team(
&self,
project: &str,
team: &str,
query_id: &str,
) -> Result<WorkItemQueryResult>
pub async fn query_by_id_for_team( &self, project: &str, team: &str, query_id: &str, ) -> Result<WorkItemQueryResult>
Execute a saved query by ID, scoped to a specific team.
§Arguments
project— The project name.team— The team name within the project.query_id— The GUID of the saved query.
§Returns
A WorkItemQueryResult scoped to the team.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn get_work_item_types(
&self,
project: &str,
) -> Result<Vec<WorkItemType>>
pub async fn get_work_item_types( &self, project: &str, ) -> Result<Vec<WorkItemType>>
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn get_work_item_type(
&self,
project: &str,
work_item_type: &str,
) -> Result<WorkItemType>
pub async fn get_work_item_type( &self, project: &str, work_item_type: &str, ) -> Result<WorkItemType>
Get a specific work item type definition.
§Arguments
project— The project name.work_item_type— The type name (e.g.,"Bug","Task").
§Returns
The WorkItemType definition including states, fields, and transitions.
Source§impl WorkItemsClient<'_>
impl WorkItemsClient<'_>
Sourcepub async fn get_fields(&self) -> Result<Vec<WorkItemField>>
pub async fn get_fields(&self) -> Result<Vec<WorkItemField>>
List all work item fields across the organization.
§Returns
A Vec<WorkItemField> describing every available work item field.