---
url: /process-functions/publishreport.md
description: The result of publishing a HierarchyBlueprint.
---

# &#x20;PublishReport&#x20;

The result of publishing a [HierarchyBlueprint](/process-functions/hierarchy-hierarchyblueprint).

```js
const report = blueprint.publish("Region", "Default");

if (!report.ok()) {
    script.fail("Publish failed: " + report.errors().join(", "));
}
```

## Constructor

Returned by [HierarchyBlueprint.publish()](/process-functions/hierarchy-hierarchyblueprint#publish). It can't be created directly.

## Overview

* **Partial publishes:** in `"BEST_EFFORT"` mode a publish can succeed for some links and fail for others. [skipped()](#skipped) and [errors()](#errors) show what didn't make it.

## Methods

### ok `ok()`  {#ok}

Returns `true` when the publish finished with no errors.

### applied `applied()`  {#applied}

Returns the number of elements applied to the hierarchy, counting each root and each linked child.

### skipped `skipped()`  {#skipped}

Returns the number of elements skipped, for example links whose child was missing. Anything above `0` means the hierarchy isn't a complete copy of the blueprint.

### errors `errors()`  {#errors}

Returns the error messages from the publish. Empty when [ok()](#ok) is `true`. Errors include validation failures, a missing dimension, cycles and individual links that couldn't be applied.

## Examples

### Report the outcome

```js
const report = blueprint.publish("Region", "Default");

script.log("Applied " + report.applied() + ", skipped " + report.skipped());

for (const error of report.errors()) {
    script.log("Error: " + error);
}
```
