set-metadata macro

set-metadata macro

Overview

The set-metadata macro is used to define metadata key=value pairs stored at the content level (page or blog post).

The values can later be retrieved using the get-metadata macro, or any other third-party app capable of reading metadata.

In addition, the values can be used as value references in any macro or feature that supports them.

Where to use it?

Optional.

One or more set-metadata macros can be used in a workflow trigger macro.

Parameters

Parameters

Required

Default

Notes

Parameters

Required

Default

Notes

first unnamed
parameter



The metadata key (name by which the value can be accessed).

macro body





The metadata value

trim



true

Should the macro body contents be trimmed (remove whitespace)?

  • true – yes, trim (recommended)

  • false – no, leave as is

page



 current page

Where should the metadata be stored (default = current page)?

  • @parent – store on the parent page, not the current page

  • @children – store on child pages, not the current page

This parameter only works on pages. It does not work for blog posts.

Basic trigger example

{workflow:name=Store metadata} {state:Test} {state} {trigger:pagecreated} {set-metadata:Document Author} @user@ {set-metadata} {trigger} {workflow}

For a trigger using the pagecreated event to work, the workflow must be applied as a space workflow.

...retrieving later

You can either:

  • Use the get-metadata macro, for example, by adding the get-metadata macro directly to the page, or in a page properties macro:

pagepropertiesmacro_get-metadatamacro_docuemntauthor_metadta_value.png
  • Retrieve it as a value reference, in any workflow macro or third-party app that supports value references

0.. using Confluence Search

Metadata values created with the set-metadata macro are only indexed by Confluence and appear in the Confluence search if the Appfire Comala Metadata app is installed.

Examples

Related pages

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.