This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.AzureDevOps.
Summary
Gets the description of a specific work item the access token provided by Azure Pipelines.
Make sure the build has the 'Allow Scripts to access OAuth token' option enabled.
- Assembly
- Cake
.AzureDevOps .dll - Namespace
- Cake
.AzureDevOps - Containing Type
- AzureDevOpsAliases
Syntax
public static AzureDevOpsWorkItem AzureDevOpsWorkItemUsingAzurePipelinesOAuthToken(this ICakeContext context, int workItemId, bool throwExceptionIfWorkItemCouldNotBeFound)
Examples
Get an Azure DevOps work item. Don't throw exception in case the work item is not found:
var workItem =
AzureDevOpsWorkItemUsingAzurePipelinesOAuthToken(42, false);
Attributes
Type | Description |
---|---|
Cake |
|
Cake |
|
Cake |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
workItemId | int | ID of the work item. |
throwExceptionIfWorkItemCouldNotBeFound | bool | Value indicating whether an exception should be thrown if work item could not be found. |
Return Value
Type | Description |
---|---|
AzureDevOpsWorkItem | Description of the work item.
Returns null if work item could not be found and
throwExceptionIfWorkItemCouldNotBeFound is set to false . |