# Contexts: Complex Only

**URL:** <https://forum.liquibase.org/t/contexts-complex-only/8937>\
**Category:** General Discussion\
**Created:** [December 27, 2023, 8:19pm UTC](https://forum.liquibase.org/t/contexts-complex-only/8937 "2023-12-27T20:19:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmenton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/wmenton/32/861_2.png) [@wmenton](https://forum.liquibase.org/u/wmenton)\
**Post date:** [December 27, 2023, 8:19pm UTC](https://forum.liquibase.org/t/contexts-complex-only/8937/1 "2023-12-27T20:19:05Z")

</div>

We’re trying to sort out how to use Contexts and Labels and we can’t figure this one scenario out.

What we want is for a changeset to be applied **only** if two conditions are true. This logic gets us the closest: `context:"@(EnvOne and EnvTwo)"`

–contexts=“EnvOne” filters it out  
–contexts=“EnvOne, EnvTwo” filters it in

But running with no contexts defined still includes it.

Simple uses of the _only_ operator (ex: `context:"@EnvOne"`) filter out changesets when no context is defined. So I’m wondering if it’s a bug with @(grouped\_contexts)?

Thanks,  
Will

ps: we’re using Liquibase 4.25.0

---

<div class="post-metadata">

**Author:** ![wmenton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/wmenton/32/861_2.png) [@wmenton](https://forum.liquibase.org/u/wmenton)\
**Post date:** [December 28, 2023, 2:16pm UTC](https://forum.liquibase.org/t/contexts-complex-only/8937/2 "2023-12-28T14:16:18Z")

</div>

More info after some experimentation

This is what I was looking for. It’s fully exclusionary and won’t run if no contexts are defined at the CLI. This is required for it to run: _–contexts=“Hello,World”_

```auto
	context:"@Hello and @World"

```

This is fully exclusionary as long as long as any contexts are defined at the CLI, _but it will run if no contexts at all are defined at the CLI_.

```auto
	context:"@(Hello and World)" 

```
