Skip to content

The expand parameter can not be used with the fields parameter #601

@VincentVrijburg

Description

@VincentVrijburg

Environment

Node version: 18.17.1
Npm version: 9.6.7
OS and version: Windows NT X64 10.0.17763 (on-prem hosted Azure DevOps agent)
azure-devops-node-api version: 13.0.0

Issue Description

When retrieving a set of work items by ids using the WorkItemTrackingApi, I get an error saying The expand parameter can not be used with the fields parameter while I only pass a value for the expand parameter.

cosnt workItemIds = [1,2,3]
const workItems = await witApi.getWorkItems(workItemIds, undefined, undefined, wi.WorkItemExpand.Relations);

Expected behaviour

I believe that when I pass undefined for optional parameters in the getWorkItems method that the optional parameters are not set at all. Only the parameters I pass a value for.

Actual behaviour

It seems that the parameters for asOf and fields are set even though they are optional and set to undefined. If the API cannot handle using the fields and expand parameter at the same time, than this should not be possible to do in the api library.

Steps to reproduce

See the code example under issue description

Logs

##[error]The expand parameter can not be used with the fields parameter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions