Skip to main content

azure_devops/work_items/methods/
get_fields_for_project.rs

1use super::super::models::WorkItemField;
2use super::super::WorkItemsClient;
3use crate::constants;
4use crate::constants::ApiPath;
5use crate::error::Result;
6
7impl WorkItemsClient<'_> {
8    /// List work item fields available in a specific project.
9    ///
10    /// # Arguments
11    ///
12    /// * `project` — The project name.
13    ///
14    /// # Returns
15    ///
16    /// A `Vec<WorkItemField>` for the given project.
17    pub async fn get_fields_for_project(&self, project: &str) -> Result<Vec<WorkItemField>> {
18        let p = ApiPath::fields();
19        self.http
20            .get(&p, &[(constants::query::PROJECT, project)])
21            .await
22    }
23}