Customization: Requirement Synchronization
The Requirement Synchronization customization turns selected source documents (for example *.requirement.feature files) into requirement work items in Azure DevOps and keeps them in sync. It can also auto-link scenarios in the same file or folder to the synchronized requirement.
Enable the customization in the customizations/requirementSynchronization section. The complete list of settings is available in the customizations configuration reference.
The example below creates User Story work items from files ending with .requirement.feature, stores their IDs with the @req-id: tag prefix, links scenarios from the same file and folder, and maps requirement description and acceptance criteria to custom fields.
{
...
"customizations": {
"requirementSynchronization": {
"enabled": true,
"requirements": [
{
"targetType": "User Story",
"condition": "$sourceFile ~ **/*.requirement.feature",
"tagPrefix": "req-id",
"linkContainerTests": true,
"linkFolderTests": true,
"acceptanceCriteriaSeparator": "Acceptance Criteria:",
"fieldUpdates": {
"Custom.Description": "{requirement-description:MarkdownToHtml}",
"Custom.AcceptanceCriteria": "{requirement-acceptance-criteria:MarkdownToHtml}"
}
}
]
}
}
...
}Linking scenarios to the requirement
Use
linkContainerTests: trueto automatically link scenarios in the same source document to the synchronized requirement work item.Use
linkFolderTests: trueto also link scenarios located in the same folder (and sub-folders) as the requirement document.You can still use
synchronization/linkstags (e.g.@req-tests:123) to link scenarios to synchronized requirements (just like linking to any work item).
Requirement source and parsing
sourceselects whether the requirement is built from aFeature(default) or from aRulewithin a feature file, allowing multiple requirements per file.acceptanceCriteriaSeparatorlets SpecSync split the description into a requirement description and acceptance criteria section, which can be mapped withfieldUpdates(see example above).
Branch tagging and extra links
Use
linksto control how tags on the requirement document (for example@bug:123) create links from the requirement work item to other work items, and override link relationships when needed.When branch tagging is enabled,
branchTagPrefixspecifies how branched requirements are tagged (pairs withcustomizations/branchTag). See Branch tag customization for details.Use
linkOnChangeto automatically link changed requirements to another work item or pull request, similarly to the Link on change customization.
Example: linking requirements to Bugs using a custom relationship
Add a tag like @bug:1234 to the requirement document to create the link using the specified relationship.
Updating requirement fields
The fieldUpdates setting works the same way as for Test Cases and can be used to fill requirement fields from the requirement description, acceptance criteria, rules, or other placeholders. See the configuration reference for the placeholder list and update options.
Last updated
Was this helpful?