# How to create a folder structure in Micro Focus QC/ALM based on the hierarchy in the source system?

### Description

When integrations are configured for any entity of the source system to **Requirement** entity in Micro Focus QC/ALM, the folder structure/Hierarchy for Requirement entity can be set/created based on 'Issue Relationship' configuration of the mapping.

For example, a user has the hierarchy of entities in the source system such as VersionOne with the parent-child relationship as shown below:

<div align="center"><img src="https://3739347370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1a8GpUm2lq3lKbytaYjt%2Fuploads%2Fgit-blob-971369cbd198a540ed8bc12eb64a8c15605aeff7%2FMICRO-FOCUS-FAQ-src.png?alt=media" alt="" width="400"></div>

Now, the user wants to synchronize this hierarchy of relationship as folder structure/Hierarchy of Requirement in Micro Focus QC/ALM as shown below:

<div align="center"><img src="https://3739347370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1a8GpUm2lq3lKbytaYjt%2Fuploads%2Fgit-blob-ada1817e7ca23dfd1da4fb42890fb1c522c5530e%2FMICRO-FOCUS-FAQ-dst.png?alt=media" alt="" width="650"></div>

### Solution

* As per the above example, we have two entities - **Epic** and **Story** in the source system, which are mapped to **Requirement** in Micro Focus ALM\QC. So we require two integrations, one for 'Epic' to 'Requirement' and the other for 'Story' to 'Requirement'. To synchronize the parent-child relationships between 'Epic' and 'Story', **Issue Relationship** needs to be configured in both the mappings.
* Create mapping for 'Epic' to 'Requirement' with the default value for 'Requirement-Type' as 'Folder'. For 'Requirement-Type' field, default value is required, so map 'Requirement-Type' with None and set default value as 'Folder'.
  * To configure default mapping, please refer [default value mappings](https://docs.opshub.com/v7.216/integrate/configure-integrations/mapping-configuration#default-mapping). For example, please refer the screenshot of <code class="expression">space.vars.SITENAME</code> mapping page given below for 'Epic' to 'Requirement' mapping with default value 'Folder' for 'Requirement-Type'.

<div align="center"><img src="https://3739347370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1a8GpUm2lq3lKbytaYjt%2Fuploads%2Fgit-blob-558328804ee0809b66fedec2c0e5393e5fb0d3d1%2FMICRO-FOCUS-FAQ-mapping-1.png?alt=media" alt="" width="1300"></div>

* In this mapping, map the relationships to synchronize parent-child relationship defined in Version One as folder-hierarchy in Micro Focus QC/ALM. To map the relationships, click **Relationships** in <code class="expression">space.vars.SITENAME</code> mapping page. A new window in which linkage between entities can be configured will open.
* Now in this window, in Entity type, map 'Backlog Item' to 'Requirements' and 'Epic' to 'Requirements' and in Link Type, map **Parent to Parent** and **Parent Epic to Parent**. Please refer [Relationship Configuration](https://docs.opshub.com/v7.216/integrate/configure-integrations/mapping-configuration#relationships) for detailed understanding of Relationship Configuration. Please confirm the configuration for entity-types and link-types as highlighted in the screenshots below:

<div align="center"><img src="https://3739347370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1a8GpUm2lq3lKbytaYjt%2Fuploads%2Fgit-blob-2f70be95c2bfd735226431d605850c27c316db6c%2FMICRO-FOCUS-FAQ-2-1.png?alt=media" alt="" width="1300"></div>

<div align="center"><img src="https://3739347370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1a8GpUm2lq3lKbytaYjt%2Fuploads%2Fgit-blob-45a884d599a645bd74bab5e868e7d1f6eb8d941a%2FMICRO-FOCUS-FAQ-2-2.png?alt=media" alt="" width="1300"></div>

* Create mapping for 'Story' to 'Requirement' with the default value for 'Requirement-Type' as 'Functional'. For 'Requirement-Type' field, default value is required, so map 'Requirement-Type' with None and set default value as 'Folder'.
  * For example, please refer the screenshot of <code class="expression">space.vars.SITENAME</code> mapping page below for mapping of 'Backlog Item' (Story) of Version One to 'Requirement' of Micro Focus QC/ALM with default value 'Functional' for 'Requirement-Type'.

<div align="center"><img src="https://3739347370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1a8GpUm2lq3lKbytaYjt%2Fuploads%2Fgit-blob-ddcfec817e6282084fc941c5bdf5b48daf74564c%2FMICRO-FOCUS-FAQ-mapping-3.png?alt=media" alt="" width="1300"></div>

* In this mapping, configure the Relationships (Parent-Child) as configured in the 'Epic' to 'Requirement' mapping.
