Skip to main content

azure_devops/work_items/methods/
get.rs

1use super::super::models::WorkItem;
2use super::super::WorkItemsClient;
3use crate::constants::ApiPath;
4use crate::error::Result;
5
6impl WorkItemsClient<'_> {
7    /// Get a single work item by its numeric ID.
8    ///
9    /// # Arguments
10    ///
11    /// * `id` — The work item ID (e.g., `42`).
12    ///
13    /// # Returns
14    ///
15    /// The [`WorkItem`] with its `fields` map populated.
16    pub async fn get(&self, id: i64) -> Result<WorkItem> {
17        let p = ApiPath::work_item(id);
18        self.http.get(&p, &[]).await
19    }
20}