Azure devops pipeline custom task - how to fill picklist from API response dynamically

144 Views Asked by At

I have created a custom task for azure devops pipeline using task,json and typescript index.ts I have a picklist which should be binded with api response name and guid fileds, but despite trying almost everything I could find its not working,

is this supported? is there any sample?

task

tried various versions of

{
            "name": "pickListTM",
            "type": "pickList",
            "label": "Select Threat Model(s)",
            "required": false,
            "defaultValue": "",
            "helpMarkDown": "List of threat models accessible to the User"
   
          },

and typescript

converted api response to

const options = [
      { 'Repo 1': '1234' },
      { 'Repo 2': '5678' },
      { 'Repo 3': '9012' }
    ];
taskLib.setVariable('pickListTM', JSON.stringify({
    
     required: true,
     options: options}));


0

There are 0 best solutions below