Requirement diagrams in Confluence
A requirement diagram links each requirement to the parts that satisfy it and the tests that verify it.
Last updated
When to use it
Use a requirement diagram for traceability in regulated or security work: a requirement with its risk and verification method, the element that satisfies it and the test case that proves it. An auditor can follow each line from the rule to the evidence.
Example
This is the code of the Encryption requirement template: a security requirement traced to what satisfies and verifies it.
requirementDiagram
requirement EncryptionAtRestAndInTransit {
id: 1
text: Data encrypted at rest and in transit
risk: high
verifymethod: test
}
requirement KeysRotatedYearly {
id: 1.1
text: Keys rotated yearly
risk: medium
verifymethod: inspection
}
element ManagedDatabaseEncryption {
type: infrastructure
docref: database encryption runbook
}
element InfrastructureComplianceCheck {
type: automated check
docref: compliance pipeline
}
ManagedDatabaseEncryption - satisfies -> EncryptionAtRestAndInTransit
InfrastructureComplianceCheck - verifies -> EncryptionAtRestAndInTransit
KeysRotatedYearly - derives -> EncryptionAtRestAndInTransit
Vellnar Diagrams draws it like this:
Change a line and the diagram changes with it. Nobody needs the original drawing file, because there is none: the code is the diagram.
Add it to a Confluence page
- Edit a Confluence page and type
/mermaidwhere the diagram should go. - Select Mermaid diagram. The editor opens with the template list.
- Pick a template, or choose Start blank and paste the code above. The preview follows every keystroke.
- Choose Save. The diagram appears on the page.
The documentation covers the editor, the settings and the exports.
Templates
The Templates button in the editor has 2 requirement diagrams ready to use:
- Encryption requirement: A security requirement traced to what satisfies and verifies it.
- Data retention: A privacy constraint split into requirements, with the job and tests behind them.
Syntax
The code of a requirement diagram starts with requirementDiagram. The Mermaid documentation describes every element of the syntax. Vellnar Diagrams draws it with Mermaid 12.3; if a line has an error, the editor marks the line and keeps the last valid diagram on screen.
More
- Mermaid in Confluence: how diagrams as code work in a page, and every diagram type.
- Security: the app asks for no permissions and sends nothing outside Atlassian.