Skip to main content

azure_devops/work_items/methods/
get_many.rs

1use super::super::models::WorkItem;
2use super::super::WorkItemsClient;
3use crate::constants;
4use crate::constants::ApiPath;
5use crate::error::Result;
6
7impl WorkItemsClient<'_> {
8    /// Get multiple work items by their IDs.
9    ///
10    /// # Arguments
11    ///
12    /// * `ids` — A slice of work item IDs to fetch.
13    ///
14    /// # Returns
15    ///
16    /// A `Vec<WorkItem>` in the same order as the requested IDs.
17    pub async fn get_many(&self, ids: &[i64]) -> Result<Vec<WorkItem>> {
18        let ids_str = ids
19            .iter()
20            .map(|id| id.to_string())
21            .collect::<Vec<_>>()
22            .join(",");
23        let p = ApiPath::work_items();
24        self.http
25            .get(&p, &[(constants::query::IDS, &ids_str)])
26            .await
27    }
28}