forked from microsoft/azure-devops-rust-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwit_work_item_queries.rs
More file actions
33 lines (25 loc) · 900 Bytes
/
wit_work_item_queries.rs
File metadata and controls
33 lines (25 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// wit_work_item_queries.rs
// Work Item query list example.
use anyhow::Result;
use azure_devops_rust_api::wit;
use std::env;
mod utils;
#[tokio::main]
async fn main() -> Result<()> {
// Get authentication credential
let credential = utils::get_credential()?;
// Get ADO configuration via environment variables
let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION");
let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT");
// Create a wit client
let wit_client = wit::ClientBuilder::new(credential).build();
// Get all work item queries
let work_item_queries = wit_client
.queries_client()
.list(&organization, &project)
.await?;
println!("All work item queries:\n{work_item_queries:#?}");
Ok(())
}