diff --git a/cyclonedx/model/contact.py b/cyclonedx/model/contact.py
index cea865e7..66790084 100644
--- a/cyclonedx/model/contact.py
+++ b/cyclonedx/model/contact.py
@@ -288,16 +288,33 @@ class OrganizationalEntity:
def __init__(
self, *,
+ bom_ref: Optional[Union[str, BomRef]] = None,
name: Optional[str] = None,
urls: Optional[Iterable[XsUri]] = None,
contacts: Optional[Iterable[OrganizationalContact]] = None,
address: Optional[PostalAddress] = None,
) -> None:
+ self._bom_ref = bom_ref
self.name = name
self.address = address
self.urls = urls or [] # type:ignore[assignment]
self.contacts = contacts or [] # type:ignore[assignment]
+ @property
+ @serializable.json_name('bom-ref')
+ @serializable.type_mapping(BomRef)
+ @serializable.xml_attribute()
+ @serializable.xml_name('bom-ref')
+ def bom_ref(self) -> Optional[BomRef]:
+ """
+ An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref MUST be
+ unique within the BOM.
+
+ Returns:
+ `BomRef`
+ """
+ return self._bom_ref
+
@property
@serializable.xml_sequence(10)
@serializable.xml_string(serializable.XmlStringSerializationType.NORMALIZED_STRING)
diff --git a/tests/_data/models.py b/tests/_data/models.py
index 6a25c552..bba0fc87 100644
--- a/tests/_data/models.py
+++ b/tests/_data/models.py
@@ -1437,6 +1437,26 @@ def get_bom_for_issue540_duplicate_components() -> Bom:
bom.register_dependency(component1, [component3])
return bom
+
+def get_bom_for_issue799_organizational_entity_bom_ref() -> Bom:
+ """regression test for issue #799
+ see https://github.com/CycloneDX/cyclonedx-python-lib/issues/799
+ """
+ return _make_bom(
+ metadata=BomMetaData(
+ tools=ToolRepository(
+ services=(
+ Service(name='service-1',
+ provider=OrganizationalEntity(
+ name='org-1',
+ bom_ref=BomRef('bom-ref-1'),
+ )),
+ )
+ )
+ )
+ )
+
+
# ---
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.0.xml.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.0.xml.bin
new file mode 100644
index 00000000..acb06612
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.0.xml.bin
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.1.xml.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.1.xml.bin
new file mode 100644
index 00000000..55ef5cda
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.1.xml.bin
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.2.json.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.2.json.bin
new file mode 100644
index 00000000..2a9b4212
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.2.json.bin
@@ -0,0 +1,15 @@
+{
+ "metadata": {
+ "timestamp": "2023-01-07T13:44:32.312678+00:00",
+ "tools": [
+ {
+ "name": "service-1"
+ }
+ ]
+ },
+ "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
+ "version": 1,
+ "$schema": "http://cyclonedx.org/schema/bom-1.2b.schema.json",
+ "bomFormat": "CycloneDX",
+ "specVersion": "1.2"
+}
\ No newline at end of file
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.2.xml.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.2.xml.bin
new file mode 100644
index 00000000..0551f582
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.2.xml.bin
@@ -0,0 +1,11 @@
+
+
+
+ 2023-01-07T13:44:32.312678+00:00
+
+
+ service-1
+
+
+
+
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.3.json.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.3.json.bin
new file mode 100644
index 00000000..0f3f0723
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.3.json.bin
@@ -0,0 +1,15 @@
+{
+ "metadata": {
+ "timestamp": "2023-01-07T13:44:32.312678+00:00",
+ "tools": [
+ {
+ "name": "service-1"
+ }
+ ]
+ },
+ "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
+ "version": 1,
+ "$schema": "http://cyclonedx.org/schema/bom-1.3a.schema.json",
+ "bomFormat": "CycloneDX",
+ "specVersion": "1.3"
+}
\ No newline at end of file
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.3.xml.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.3.xml.bin
new file mode 100644
index 00000000..7d959fb2
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.3.xml.bin
@@ -0,0 +1,11 @@
+
+
+
+ 2023-01-07T13:44:32.312678+00:00
+
+
+ service-1
+
+
+
+
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.4.json.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.4.json.bin
new file mode 100644
index 00000000..eef216da
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.4.json.bin
@@ -0,0 +1,15 @@
+{
+ "metadata": {
+ "timestamp": "2023-01-07T13:44:32.312678+00:00",
+ "tools": [
+ {
+ "name": "service-1"
+ }
+ ]
+ },
+ "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
+ "version": 1,
+ "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json",
+ "bomFormat": "CycloneDX",
+ "specVersion": "1.4"
+}
\ No newline at end of file
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.4.xml.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.4.xml.bin
new file mode 100644
index 00000000..e7e377e2
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.4.xml.bin
@@ -0,0 +1,11 @@
+
+
+
+ 2023-01-07T13:44:32.312678+00:00
+
+
+ service-1
+
+
+
+
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.5.json.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.5.json.bin
new file mode 100644
index 00000000..bf352045
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.5.json.bin
@@ -0,0 +1,31 @@
+{
+ "metadata": {
+ "timestamp": "2023-01-07T13:44:32.312678+00:00",
+ "tools": {
+ "services": [
+ {
+ "name": "service-1",
+ "provider": {
+ "bom-ref": "bom-ref-1",
+ "name": "org-1"
+ }
+ }
+ ]
+ }
+ },
+ "properties": [
+ {
+ "name": "key1",
+ "value": "val1"
+ },
+ {
+ "name": "key2",
+ "value": "val2"
+ }
+ ],
+ "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
+ "version": 1,
+ "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
+ "bomFormat": "CycloneDX",
+ "specVersion": "1.5"
+}
\ No newline at end of file
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.5.xml.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.5.xml.bin
new file mode 100644
index 00000000..d3656fac
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.5.xml.bin
@@ -0,0 +1,20 @@
+
+
+
+ 2023-01-07T13:44:32.312678+00:00
+
+
+
+
+ org-1
+
+ service-1
+
+
+
+
+
+ val1
+ val2
+
+
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.6.json.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.6.json.bin
new file mode 100644
index 00000000..148f49dd
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.6.json.bin
@@ -0,0 +1,31 @@
+{
+ "metadata": {
+ "timestamp": "2023-01-07T13:44:32.312678+00:00",
+ "tools": {
+ "services": [
+ {
+ "name": "service-1",
+ "provider": {
+ "bom-ref": "bom-ref-1",
+ "name": "org-1"
+ }
+ }
+ ]
+ }
+ },
+ "properties": [
+ {
+ "name": "key1",
+ "value": "val1"
+ },
+ {
+ "name": "key2",
+ "value": "val2"
+ }
+ ],
+ "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
+ "version": 1,
+ "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
+ "bomFormat": "CycloneDX",
+ "specVersion": "1.6"
+}
\ No newline at end of file
diff --git a/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.6.xml.bin b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.6.xml.bin
new file mode 100644
index 00000000..0e695bf2
--- /dev/null
+++ b/tests/_data/snapshots/get_bom_for_issue799_organizational_entity_bom_ref-1.6.xml.bin
@@ -0,0 +1,20 @@
+
+
+
+ 2023-01-07T13:44:32.312678+00:00
+
+
+
+
+ org-1
+
+ service-1
+
+
+
+
+
+ val1
+ val2
+
+