- 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
modifyChangeSetsvalue is not applied to that changeset, matching the behavior of othermodifyChangeSetsattributes likefailOnErrorandpreConditions.Changesets outside the
modifyChangeSetsblock are not affected.You can combine the changeset attributes with existing
modifyChangeSetsattributes likerunWithandpreConditionson the same block.You can use
modifyChangeSetswith the changeset attributes in XML, YAML, and JSON changelogs. Attribute names are case-insensitive, except in XML changelogs, where they must be lowercase (teams, notTeams).
Procedure
Create changelog files
Create the changelog files you want to tag. The changesets inside them do not need any attribute values of their own.
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.
Deploy with a filter
Run a command with the matching filter argument to target one group:
liquibase update --teams-filter=securityThis 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.