Azure devops 挑选列表Azure Devops自定义任务
如何使用json文件填充Azure Devops任务中的拾取列表 我有这个json文件:Azure devops 挑选列表Azure Devops自定义任务,azure-devops,azure-pipelines-build-task,picklist,Azure Devops,Azure Pipelines Build Task,Picklist,如何使用json文件填充Azure Devops任务中的拾取列表 我有这个json文件: [ {"Item1":"Item1"}, {"Item2":"Item2"}, {"Item3":"Item3"}, {"Itemn":"Itemn"} ] 我需要选择列表将此文件作为一个参数,并显示此选项,有些人会
[
{"Item1":"Item1"},
{"Item2":"Item2"},
{"Item3":"Item3"},
{"Itemn":"Itemn"}
]
我需要选择列表将此文件作为一个参数,并显示此选项,有些人会这样想
{
"name": "businessprocess",
"type": "pickList",
"label": "Business",
"defaultValue": "",
"required": true,
"helpMarkDown": "Select One"
"options": path to jsonFile....
}
恐怕我们没有这种现成的方法来用另一个json文件填充选择列表 您可以检查,
选项
元素被设计为对象
类型。正如我所知,json对象应该以key/value
成对编写,格式为{“key1”:“xx”,“key2”:xx,“key3”:xx}
。因此,不能将jsonFile的路径作为options
元素的属性传递,这不是options
的期望键值对
相反,我认为您应该直接在tasks.json文件中编写键值对,就像我们所做的那样:
"options": {
"build": "build",
"push": "nuget push",
"pack": "pack",
"publish": "publish",
"restore": "restore",
"run": "run",
"test": "test",
"custom": "custom"
}