> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Target Document Creation

> Control where new work items are stored when created from Nextedy RISKSHEET by configuring the `createInDocument` parameter to decouple item loading from item creation paths.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Why Configure a Target Document

By default, when you create a new linked work item from a Risksheet column, the item is stored in the Polarion tracker rather than in a specific document. For regulated workflows (FMEA, HARA), you typically need new risk controls, mitigation tasks, or verification activities stored in designated documents to maintain document-level traceability.

The `createInDocument` parameter lets you specify exactly which document receives new items, independently of where existing items are loaded from.

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/-Icoak49xQVOW38R/risksheet/diagrams/guides/advanced/target-document-creation/diagram-1.svg?fit=max&auto=format&n=-Icoak49xQVOW38R&q=85&s=5a49ae12273468b4b03baecae658237f" alt="diagram" style={{ maxWidth: "700px", width: "100%" }} width="700" height="140" data-path="risksheet/diagrams/guides/advanced/target-document-creation/diagram-1.svg" />
</Frame>

The read and write paths are completely independent. You can load items from the entire project while creating new ones in a specific document.

<Steps>
  <Step title="Configure for Downstream Items">
    For downstream task and mitigation items, place `createInDocument` inside the `dataTypes` section of your sheet configuration:

    ```yaml theme={null}
    dataTypes:
      task:
        type: mitigationAction
        role: mitigates
        createInDocument: Risks/Tasks
    ```

    The `createInDocument` value uses the `folder/docID` path format, matching the Polarion document structure.

    <Warning title="Without createInDocument, Items Go to the Tracker">
      If `createInDocument` is not set, newly created linked items are stored in the project's work item tracker rather than in any document. This breaks document-based traceability and audit trails required for ISO 26262 and ISO 14971 compliance.
    </Warning>
  </Step>

  <Step title="Configure for Upstream Items">
    For upstream linked items, place `createInDocument` in the column's `typeProperties`:

    ```yaml theme={null}
    {
      "columns": [
        {
          "header": "System Req",
          bindings: "sysReq",
          "type": "itemLink",
          "typeProperties": {
            "linkTypes": "systemRequirement",
            "linkRole": "refines",
            "createInDocument": "Requirements/SystemReqs"
          }
        }
      ]
    }
    ```

    | Item Direction                 | Configuration Location                      | Example                     |
    | ------------------------------ | ------------------------------------------- | --------------------------- |
    | Downstream (tasks, measures)   | `dataTypes.task.createInDocument`           | `"Risks/Tasks"`             |
    | Upstream (requirements, links) | `columns[].typeProperties.createInDocument` | `"Requirements/SystemReqs"` |
  </Step>

  <Step title="Use createInCurrentDocument for Document-Scoped Items">
    When you want new items stored in the current document rather than a separate one, use `createInCurrentDocument`:

    ```yaml theme={null}
    typeProperties:
      linkTypes: riskControl
      linkRole: controls
      createInCurrentDocument: true
    ```

    This is useful when each Risksheet document should contain its own risk items rather than storing them in a shared document.

    <Tip title="Multi-Project Columns">
      For `itemLink` and `multiItemLink` columns that load items from multiple projects, use `createInCurrentDocument: true` to ensure new items are always stored in the current project's document context.
    </Tip>
  </Step>
</Steps>

## Common Pattern: Load Project-Wide, Create in Specific Document

A frequent configuration pattern loads existing items from the entire project (no `document` parameter) while directing new items to a specific document:

```yaml theme={null}
dataTypes:
  task:
    type: mitigationAction
    role: mitigates
    query: type:mitigationAction
    createInDocument: Risks/MitigationTasks
```

This loads all mitigation actions from the project but creates new ones exclusively in `Risks/MitigationTasks`.

## Limitations

| Limitation                 | Notes                                                                                                          |
| -------------------------- | -------------------------------------------------------------------------------------------------------------- |
| No chapter-level placement | Risksheet creates items at the document level; placement within specific chapters or headings is not supported |
| Target document must exist | The document specified in `createInDocument` must already exist in the Polarion project structure              |
| Path format is fixed       | Use `folder/docID` format only -- no wildcards or expressions                                                  |

<Warning title="Dynamic Document References">
  Reading document custom field values dynamically in sheet configuration (e.g., referencing a `subsheetName` custom field) is not natively supported. If you need dynamic document targets, consider using importer scripts to populate the configuration before opening the Risksheet.
</Warning>

## Verification

After configuring `createInDocument`:

1. Open the Risksheet document and create a new downstream task or linked item
2. Save the document
3. Navigate to the target document in Polarion

You should now see the newly created work item stored in the specified target document rather than in the project tracker.

## See Also

* [Configure Downstream Tasks](/risksheet/guides/risk-management/downstream-tasks) -- task data type configuration
* [Configure Multiple Downstream Types](/risksheet/guides/risk-management/multiple-downstream-types) -- multiple task types with different target documents
* [Configure Cross-Project Linking](/risksheet/guides/advanced/cross-project-linking) -- cross-project item creation and display
* [Configure Multi-Project Setup](/risksheet/guides/configuration/multi-project-setup) -- project-level configuration

<LastReviewed date="2026-06-08" />
