-1

HI Azure pipeline i am getting struck and having error while doing this

parameters:

  - name: applications_module
    displayName: Applications
    type: boolean
    default: 'false'
    values: []
  - name: management_module
    displayName: Management
    type: boolean
    default: 'false'
    values: []
  - name: Creation
    displayName: Creation
    type: boolean
    default: 'false'
    values: []

variables:
- name: FilterValue 
    ${{each item in parameters}}:
      ${{if contains(item.name, '_module')}}: 
      value:  item.name # here I want to concatenate all the parameters names that have name _module but this statement is throwing an error 

I am not able to its saying "'value' is already defined" so can anyone help me regarding this

ksk
  • 165
  • 14
  • your parameters have `type: boolean` but it should be `type: object`. – Thomas Sep 18 '22 at 09:57
  • not sure you can do this way, you could always write a script to do that tho – Thomas Sep 18 '22 at 09:58
  • can you help me with any Example Script or idea about how to write that script – ksk Sep 19 '22 at 03:24
  • @Thomas My my parameters play a vital role and i cannot change their type as object I want to have a variable that will show all the parameters display names as comma separated string so that is the reason iam looping it – ksk Sep 20 '22 at 15:33

1 Answers1

0

using ##VSO we can do that

   steps:
   - ${{ each parameter in parameters }}:
     - bash: echo '##vso[task.setvariable variable=allParametersString]$(allParametersString)${{ parameter.Key }}'
                   
  - script:
      echo 'concatenated strings by comma .->$(allParametersString)' 
ksk
  • 165
  • 14