Rate this page:
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 2import { 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.
Sets the value of my-key on the Confluence page with page id 123.
1 2properties.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>
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 2await properties.onConfluencePage('123').get('my-key');
Deletes the my-key key-value pair on the Confluence page with the page id 123.
1 2await properties.onConfluencePage('123').delete('my-key');
Sets the value of my-key on the Confluence space with space key SPACEKEY.
1 2properties.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>
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 2await properties.onConfluenceSpace('SPACEKEY').get('my-key');
Deletes the my-key key-value pair on the Confluence space with the space key SPACEKEY.
1 2await properties.onConfluenceSpace('SPACEKEY').delete('my-key');
Sets a key-value pair on a specified Jira issue.
1 2properties.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>
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 2await 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 2await properties.onJiraIssue('FORGE-123').delete('my-key');
Sets the value of my-key on the Jira project with project key FORGE.
1 2properties.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>
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 2await properties.onJiraProject('FORGE').get('my-key');
Deletes the my-key key-value pair on the Jira project with the project key FORGE.
1 2await properties.onJiraProject('FORGE').delete('my-key');
Rate this page: