AzureDevOpsAliases.

AzureDevOpsWorkItemUsingAzurePipelinesOAuthToken(ICakeContext, int, bool) Method

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
CakeMethodAliasAttribute
CakeAliasCategoryAttribute
CakeNamespaceImportAttribute

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.