JSON structure
This page includes JSON samples for two types of external actions: a custom button and a sidebar plugin. It also describes the properties and the supported URL tokens.
For details on creating external actions, see Create external actions.
Notes
If you upload a zip bundle, and not define the JSON object directly in the External action editor, do not use square brackets [...] to introduce an array. You cannot define arrays of configurations when uploading a zip bundle.
Custom toolbar button sample
The following is an example of a JSON for a custom toolbar button.
[
{
"name": "defect-details",
"title": "Defect Details",
"entity_type": ["defect"],
"views": ["list", "details"],
"icon": "rss",
"url": "https://server.domain.com/some-application?entity_ids={entity_ids}&entity_type={entity_type}&shared_space={shared_space}&workspace={workspace}&user_login={user_login}&email={user_email}&action=defect-details",
"single_entity": true,
"events": false,
"dialog": "large"
}
]
Sidebar plugin sample
The following is an example of a JSON for a custom sidebar plugin.
[
{
"name": "general-details-in-panel",
"title": "Custom Preview",
"entity_type": [
"work_item",
"test"
],
"views": [
"list"
],
"icon": "details",
"url": "{bundle_url}/external-details/external-details.html?shared_space={shared_space}&workspace={workspace}&user_login={user_login}&email={user_email}&octane_url={octane_url}&context_release={context_release}&context_sprint={context_sprint}&context_milestone={context_milestone}&context_program={context_program}#entity_ids={entity_ids}&entity_type={entity_type}&query={query}",
"mode": {
"name": "side_panel",
"modules": [
"backlog",
"team_backlog"
]
}
},
{
"name": "pipeline-details",
"title": "Pipeline Preview",
"entity_type": [
"run_history"
],
"views": [
"list"
],
"icon": "details",
"url": "{bundle_url}/external-details/external-details.html?shared_space={shared_space}&workspace={workspace}&user_login={user_login}&email={user_email}&octane_url={octane_url}&context_program={context_program}&context_pipeline={context_pipeline}&context_pipeline_run={context_pipeline_run}#entity_ids={entity_ids}&entity_type={entity_type}&query={query}",
"mode": {
"name": "side_panel",
"modules": [
"pipelines"
]
}
}
]
Custom action properties
Include the following properties in the action definition.
Property | Description |
---|---|
name | Unique action or tab name, used for identification in logs and errors. |
mode |
For sidebars only (optional): Includes two properties:
|
title |
For toolbars where the icon and label are displayed, this value is used as the button label. For toolbars where only the icon is displayed, this value is used as the button tooltip. For sidebar plugins, this value is used as the sidebar name. |
entity_type |
List of entity types to which the external action is applied. The entity type names are same as in the REST API. For example: defect, test, release. You can use also aggregated types, such as work_item. The action is applied to all subtypes of the aggregated type. For example: Define the type work_item to apply the action to user stories, defects. |
views |
The view types in which the action or sidebar should be displayed. Allowed values: list, details |
icon | The icon to be displayed for the button or sidebar. See the list of possible JSON structure. |
single_entity |
Use one of the following values:
|
dialog |
For custom buttons only: By default, the referenced website or application opens in a new tab. To embed an application inside a dialog box, rather than a new tab, define the dialog property. Allowed values: small, medium, large Caution: Embedding an action can pose security risks for users if the embedded application is not properly secured. If dialog is defined, the url property needs to contain the source of an iframe that is open inside the dialog box. The embedded application can trigger events that control its dialog box, through "messages". A message is handled only if the values of workspace, shared_space and dialog_id are identical to those that were provided to the embedded application. Any other values cause the message to be ignored. For message examples, see JSON structure. |
url |
Custom button: The URL or URI to be activated when a user interacts with the custom button. Sidebar or dialog box: The source of the iframe. Provide one of the following:
In addition to the URL or URI of the target application, you can also include tokens. Tokens represent information regarding the selected entities. During runtime, the tokens are replaced with the actual values which are hen transferred to the target application. The following example demonstrates the usage of tokens that you can include in the url property:
You can include part or all of the supported tokens in the URL. It is best to include only the tokens that are required by the invoked application. In addition, you can add other query parameters to the URL to send additional information to the target application. In the example above, For a list of the supported URL parameters, see Supported URL tokens. |
events |
(Optional) Indicate whether the action supports receiving events back from the target web application. Allowed values: true / false Default: false. This functionality poses a potential security risk. For a list of supported events and code examples, see JSON structure. |
workspaces |
(Optional) When present, designates the workspaces to which the action applies. Syntax: Number array of workspace IDs. Example: Note: |
exclude_workspaces |
(Optional) When present, designates the workspaces to which the action does not apply. Syntax: Number array of workspace IDs. Example: Note: |
modules | For sidebars only: The modules in which to show the sidebar plugin. For a list of the available modules, see the mode row above. |
Supported URL tokens
You can include the following tokens in the URL property.
Parameter | Details |
---|---|
{bundle_url}
|
When uploading the external action bundle as a zip, use this token as a replacement for the OpenText Core Software Delivery Platform URL.
Where For more details, see JSON structure. |
{entity.foo_field}
|
Any of the entity's fields, including UDF, of type String, Number, Boolean, and Date. Relevant only if By including a field in the action's URL, you can browse to specific items in external systems. For example, if you store in a UDF the ID of a ticket from an external system, you can use an external action to compose a URL to that ticketing system and include the ticket ID in the URL. If you synchronize entities from OpenText Application Quality Management to OpenText Core Software Delivery Platform, and the OpenText Application Quality Management IDs are stored in a UDF, you can compose an external action that uses the OpenText Application Quality Management TD:// protocol in the URL to open the item directly in OpenText Application Quality Management. External actions that include fields work on single entities only. Two levels are supported, for example |
{entity_type}
|
Aggregated type of the selected entity. For example, for a defect, this is replaced with work_item. |
{entity_ids}
|
Comma-delimited list of IDs of the entity or entities selected by the user. Note: When using the |
{query}
|
The External actions can use this token to construct a REST request to fetch the items displayed in a grid or board view. This token is particularly useful when invoking an external action in a grid or board view with no selected items, or when the Select all option is active. The reason is that when using the |
{all_selected} |
External actions can use the The This parameter is useful in the following case: When an external action is invoked, and there are more than 500 selected items, only the first 500 item IDs are returned as part of the If you receive 500 item IDs, this may indicate that more than 500 items can be selected in the view. You can verify this with the In this case, the |
{octane_url}
|
URL of the OpenText Core Software Delivery Platform site from which the external action is invoked. |
{panel_id}
|
In case of an action embedded in a dialog box or a panel, this value is required to post messages from the action back to OpenText Core Software Delivery Platform. For more details, see JSON structure. |
{shared_space}
|
ID of the space in which the action was triggered. |
{user_email}
|
Email address of a user as recorded in OpenText Core Software Delivery Platform. |
{user_login}
|
Login name with which the user connected to OpenText Core Software Delivery Platform. |
{user_identity_token}
|
Use this token to allow external applications to validate the identity of the OpenText Core Software Delivery Platform user that invoked an external action. For details, see JSON structure. |
{workspace}
|
ID of a workspace in which the action was triggered. |
{xsrf_token}
|
Use this token in the following scenarios:
|