Async events API
Fetch API
Storage API

Rate this page:

Properties API (deprecated)

The Properties API exported by @forge/api is deprecated, and will be removed on May 1, 2024. You should now interact with properties through each product's respective REST API instead.

The Properties API provides methods to store key-value pairs on specific product contexts.

Import the Forge API package in your app, as follows:

1
2
import { properties } from '@forge/api';

The store API has been renamed to the properties API. The existing exported API is still available, however it has been deprecated and will be removed in the future.

onConfluencePage

Sets the value of my-key on the Confluence page with page id 123.

Method signature

1
2
properties.onConfluencePage(pageId: string).set(key: string, value: string | number | array | object) => Promise<void>
properties.onConfluencePage(pageId: string).get(key: string) => Promise<string | number | array | object | undefined>
properties.onConfluencePage(pageId: string).delete(key: string) => Promise<void>

Example

Sets the value of my-key on the Confluence page with page id 123.

1
2
// String
await properties.onConfluencePage('123').set('my-key', 'hello-world');

// Number
await properties.onConfluencePage('123').set('my-key', 123);

// Array
await properties.onConfluencePage('123').set('my-key', [ 'hello', 'world' ]);

// Object
await properties.onConfluencePage('123').set('my-key', { hello: 'world' });

Gets the value of my-key on the Confluence page with page id 123.

1
2
await properties.onConfluencePage('123').get('my-key');

Deletes the my-key key-value pair on the Confluence page with the page id 123.

1
2
await properties.onConfluencePage('123').delete('my-key');

onConfluenceSpace

Sets the value of my-key on the Confluence space with space key SPACEKEY.

Method signature

1
2
properties.onConfluenceSpace(spaceId: string).set(key: string, value: string | number | array | object) => Promise<void>
properties.onConfluenceSpace(spaceId: string).get(key: string) => Promise<string | number | array | object | undefined>
properties.onConfluenceSpace(spaceId: string).delete(key: string) => Promise<void>

Example

Sets the value of my-key on the Confluence space with space key SPACEKEY.

1
2
// String
await properties.onConfluenceSpace('SPACEKEY').set('my-key', 'hello-world');

// Number
await properties.onConfluenceSpace('SPACEKEY').set('my-key', 123);

// Array
await properties.onConfluenceSpace('SPACEKEY').set('my-key', [ 'hello', 'world' ]);

// Object
await properties.onConfluenceSpace('SPACEKEY').set('my-key', { hello: 'world' });

Gets the value of my-key on the Confluence space with space key SPACEKEY.

1
2
await properties.onConfluenceSpace('SPACEKEY').get('my-key');

Deletes the my-key key-value pair on the Confluence space with the space key SPACEKEY.

1
2
await properties.onConfluenceSpace('SPACEKEY').delete('my-key');

onJiraIssue

Sets a key-value pair on a specified Jira issue.

Method signature

1
2
properties.onJiraIssue(issueKey: string).set(key: string, value: string | number | array | object) => Promise<void>
properties.onJiraIssue(issueKey: string).get(key: string) => Promise<string | number | array | object | undefined>
properties.onJiraIssue(issueKey: string).delete(key: string) => Promise<void>

Example

Sets the value of my-key on the Jira issue with issue key FORGE-123.

1
2
// String
await properties.onJiraIssue('FORGE-123').set('my-key', 'hello-world');

// Number
await properties.onJiraIssue('FORGE-123').set('my-key', 123);

// Array
await properties.onJiraIssue('FORGE-123').set('my-key', [ 'hello', 'world' ]);

// Object
await properties.onJiraIssue('FORGE-123').set('my-key', { hello: 'world' });

Gets the value of my-key on the Jira issue with issue key FORGE-123.

1
2
await properties.onJiraIssue('FORGE-123').get('my-key');

Deletes the my-key key-value pair on the Jira issue with the issue key FORGE-123.

1
2
await properties.onJiraIssue('FORGE-123').delete('my-key');

onJiraProject

Sets the value of my-key on the Jira project with project key FORGE.

Method signature

1
2
properties.onJiraProject(projectKey: string).set(key: string, value: string | number | array | object) => Promise<void>
properties.onJiraProject(projectKey: string).get(key: string) => Promise<string | number | array | object | undefined>
properties.onJiraProject(projectKey: string).delete(key: string) => Promise<void>

Example

Sets the value of my-key on the Jira project with project key FORGE.

1
2
// String
await properties.onJiraProject('FORGE').set('my-key', 'hello-world');

// Number
await properties.onJiraProject('FORGE').set('my-key', 123);

// Array
await properties.onJiraProject('FORGE').set('my-key', [ 'hello', 'world' ]);

// Object
await properties.onJiraProject('FORGE').set('my-key', { hello: 'world' });

Gets the value of my-key on the Jira project with project key FORGE.

1
2
await properties.onJiraProject('FORGE').get('my-key');

Deletes the my-key key-value pair on the Jira project with the project key FORGE.

1
2
await properties.onJiraProject('FORGE').delete('my-key');

Rate this page: