• Task
  • Version ยท 6.0
  • Create

Apply changeset attributes in bulk with modifyChangeSets

Last updated: September 29, 2026

You can apply changeset attributes to every changeset in your included changelogs by setting the attributes once on a modifyChangeSets block, instead of editing each changeset individually. modifyChangeSets accepts the labels, contextFilter, teams, releases, keywords, and conditions changeset attributes.

How it works

When you set a changeset attribute on a modifyChangeSets block, Liquibase treats every changeset referenced with include or includeAll inside that block as if the attribute were authored on the changeset itself. The changesets can then be targeted with the matching runtime argument, such as --label-filter or --teams-filter, and appear with those values in operation reports.

  • If a changeset already sets its own value for an attribute, the changeset-level value takes priority. The modifyChangeSets value is not applied to that changeset, matching the behavior of other modifyChangeSets attributes like failOnError and preConditions.

  • Changesets outside the modifyChangeSets block are not affected.

  • You can combine the changeset attributes with existing modifyChangeSets attributes like runWith and preConditions on the same block.

  • You can use modifyChangeSets with the changeset attributes in XML, YAML, and JSON changelogs. Attribute names are case-insensitive, except in XML changelogs, where they must be lowercase (teams, not Teams).

Procedure

1

Create changelog files

Create the changelog files you want to tag. The changesets inside them do not need any attribute values of their own.

2

Wrap the includes in modifyChangeSets blocks

In your root changelog, wrap each group of includes in a modifyChangeSets block and set the attributes once per block. Changesets that should not be tagged go outside the blocks.

loading

loading

loading
3

Deploy with a filter

Run a command with the matching filter argument to target one group:

liquibase update --teams-filter=security

This deploys the changesets in security-changes.xml (tagged teams="security" through modifyChangeSets) and the untagged changesets in general-changes.xml, because changesets without a teams attribute always run. The changesets in platform-changes.xml are excluded because their teams value does not match the filter.