microsoft / azure-devops-extension-sdk

Client SDK for developing Azure DevOps extensions
MIT License
122 stars 38 forks source link

Custom picklist values in Pipeline Task #61

Open BlueBasher opened 1 year ago

BlueBasher commented 1 year ago

Hi,

I have created an extension that adds an Azure Pipelines Task. The inputs for the task contain a picklist and it's being populated by using sourceDefinitions. This has always worked fine but roughly around August 2022 it has stopped working.

The definition of the task looks like this:

    "inputs": [
        {
            "name": "workItemType",
            "type": "picklist",
            "label": "WorkItem Type",
            "defaultValue": "",
            "required": true,
            "helpMarkDown": "The type of workitems to update, e.g. User Story, Task or Bug. You can use a comma-separated string to supply multiple values."
        }
    ],
    "sourceDefinitions": [
        {
            "target": "workItemType",
            "endpoint": "/$(system.teamProject)/_apis/wit/workItemTypes?api-version=1.0",
            "selector": "jsonpath:$.value[*].name",
            "authKey": "tfs:teamfoundation"
        }        
    ]

If I try to populate the dropdown in the UI, it will execute a request to https://bluebasher-sandbox.visualstudio.com/_apis/distributedtask/endpoint With the following payload:

{
    "url": "/TestWiki/_apis/wit/workItemTypes?api-version=1.0",
    "selector": "jsonpath:$.value[*].name",
    "connectionId": "tfs:00025394-6065-48CA-87D9-7F5672854EF7",
    "scope": "f9bd23c4-e6b5-4e71-96c7-d4daa63f7943",
    "taskId": "7164116a-ed17-48be-9c53-b440b2b1dd2e",
    "keySelector": ""
}

And it returns this error:

{
    "$id": "1",
    "innerException": null,
    "message": "No service connection found with identifier tfs:00025394-6065-48CA-87D9-7F5672854EF7.",
    "typeName": "Microsoft.TeamFoundation.DistributedTask.WebApi.EndpointNotFoundException, Microsoft.TeamFoundation.DistributedTask.WebApi",
    "typeKey": "EndpointNotFoundException",
    "errorCode": 0,
    "eventide": 3000
}

So it seems to me that somewhere the authkey tfs:teamfoundation is being replaced by an actual (internal?) Service Connection, which does not exists anymore?