requirement convert template added

This commit is contained in:
Dirk Alders 2025-03-17 12:09:58 +01:00
parent d24a1280fc
commit d02aec9aa4

View File

@ -0,0 +1,36 @@
def specification(req_spec):
req_spec.title({{ data.titel|tojson }})
{% set sec = namespace(cnt = 1) %}
{%- for uid in data.uid_list_sorted %}
{%- with item=data.item_dict[uid] %}
{%- if item.system_type_uid == '_4-K5EHYYEem_kd-7nxt1sg' %}
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id={{ sec.cnt }},
{%- set sec.cnt = sec.cnt + 1 %}
heading={{ item.Heading|tojson }},
)
{%- elif item.system_type_uid == '_MR7eNHYYEem_kd-7nxt1sg' %}
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id={{ item.ID[4:]}},
heading={{ item.Heading|tojson }},
{%- if 'Description' in item and item.Description != '' %}
description={{ item.Description|tojson }},
{%- if 'ReasonForImplementation' in item and item.ReasonForImplementation != '' %}
reason={{ item.ReasonForImplementation|tojson }},
{%- endif %}
{%- if 'Fitcriterion' in item and item.Fitcriterion != '' %}
fitcriterion={{ item.Fitcriterion|tojson }},
{%- endif %}
{%- endif %}
)
{%- endif %}
{%- endwith %}
{%- endfor %}