1

Summary: How to skip a task in a Azure Devops Task Group based on a parameter value, using Classic Pipelines.

Hi,

In Azure DevOps using Classic Pipelines, I have a Task Group with parameters and I want to use one of these parameters to decide if one of the tasks should be executed. I tried every format I could find but I am never able to get the parameter value when running this group.

parameter: condition:

task group configuration:

I've tried the following notations and probably some more, but nothing worked. Either there was an error in the building process or the variable was evaluated to NULL.

  1. not(eq(variables['parameters.CustomKey'], '-'))
  2. not(eq(variables['CustomKey'], '-'))
  3. not(eq('${{ variables.CustomKey }}', '-'))
  4. not(eq('${{ parameters.CustomKey }}', '-'))

I followed what is explained here but it seems most explanations are for YAML and not classic pipelines.

Any help would be appreciated. Thanks!

1 Answer 1

4

Here is an example from my task group:

enter image description here

In your case, the second option is close to being true. Try to use the custom condition:

and(succeeded(), ne(variables['CustomKey'], '-'))

Sign up to request clarification or add additional context in comments.

1 Comment

You're absolutely right, used your condition and it worked! I don't know what I was doing wrong, maybe it was the ne instead on not(eq( or maybe the and + succeeded... either way thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.