App Settings
App settings let administrators configure an app without changing its code. Developers declare the available settings in the app package.
System administrators provide values globally, and project administrators can configure values for individual projects. App scripts use these values to control the app's behavior.
Define App Settings
Add a file named settings.json to the root of the app package. Define its schema using JSON Schema Draft 7.
The schema describes an object whose properties define the app settings. Each property name is the key of a setting, and its schema declares the setting's type and constraints. YouTrack uses these declarations to create the settings form, validate values, and store configuration.
Widget configuration uses a separate schema. For details, see Widget Configuration.
Supported Setting Types
Choose the type that matches the value an administrator needs to configure:
Type | Use |
|---|---|
| Text. For credentials, use the secret format. |
| Whole numbers. |
| Numbers that can include a fractional part. |
| A |
| A single YouTrack entity reference. A top-level object setting requires |
| A list of primitives, YouTrack entities, or ordinary objects with declared fields. For declarations and supported shapes, see Arrays. |
Ordinary objects can be used as rows in an array setting and as nested objects inside those rows.
Basic Settings Example
This file declares one text setting named message:
The settings form displays Message as the field label. If a value is provided, minLength requires at least one character.
Required Settings and Defaults
To require a setting, list its key in the root required array. For example, "required": ["message"] requires the setting in the example above.
Missing required settings prevent the affected app or project configuration from running. YouTrack displays a warning until the required values are configured.
Use default to initialize an ordinary string, integer, number, boolean, or primitive array. Defaults initialize missing values without replacing saved values. Configure secret values explicitly. Defaults are not supported for entity references or arrays of objects or entities.
For an array, required and minItems serve different purposes: required requires a setting value, while minItems sets the minimum number of items. Use minItems: 1 together with required when an array must contain at least one item.
Configure Setting Values
After installing the app, configure its values on the app's Settings tab. Global configuration provides shared values, and project configuration can provide overrides.
To set values for app settings on the global level:
From the Administration menu, select Apps.
Select the target app from the list.
Open the Settings tab for this app.
Update values for the settings of the app.
When ready, click the Save button.
The values for the app settings are saved on the global level.
The values are updated in all projects where this app is attached and where the app settings are synchronized with the global app settings.
To set values for app settings on the project level:
In the project settings, open the Apps tab.
Select the target app from the list.
Open the Settings tab for this app.
Set values for the settings of the app.
When ready, click the Save button.
The values for the app settings are saved on the project level.
The values you've just set overwrite any global-level values for these settings.
The settings that you've updated stop being synchronized with the global app settings.
For array-specific override rules, see Project Overrides for Arrays.
Use Setting Values in Scripts
In app scripts, read a setting through ctx.settings.<settingName>. For example, an HTTP handler or workflow action can read the basic text setting as follows:
The setting's declaration determines the value exposed to scripts. Settings for ordinary text, numbers, and boolean values expose JavaScript primitives. Entity settings expose scripting API entities, and secret settings expose opaque values. Array settings expose the collection types described in Use Array Values in Scripts.
Use the settings form or REST configuration to save configuration changes. For data that backend scripts need to store and update, see Extension Properties.
YouTrack Entity Settings
To let an administrator select a YouTrack entity, declare an object-typed setting with x-entity. The x-entity value identifies the entity type.
Supported entity types are Issue, Article, Project, User, and UserGroup.
This declaration lets an administrator select one user:
In scripts, ctx.settings.owner exposes the selected User entity. For multiple selections, use an entity array.
Secret Settings
For credentials such as authentication tokens, declare a string setting with "format": "secret":
The settings form hides secret input. Saved secret values are represented by the <***> mask in REST settings responses.
Scripts receive an opaque secret value. Converting the value to a string returns the mask. Pass the value directly to the supported http.Connection methods:
bearerAuth for bearer token authentication.
basicAuth for basic authentication.
The query parameter values of request methods such as getSync.
This function uses the configured token to authenticate an HTTP request:
To require a secret setting, list its key in the root required array. For secrets in repeatable rows, see Secrets in Array Items.
Arrays
Use an array-typed setting for a list of values or repeatable configuration rows. Declare the setting in the root properties object and provide one items schema for all items.
The item schema determines the supported values and the collection returned to backend scripts:
Item type | Declaration | Backend script value |
|---|---|---|
| JavaScript array: use | |
| YouTrack API Set: use | |
| JavaScript array of row objects. Fields retain their declared types. |
Primitive Arrays
Use a primitive array for a list of text, numeric, or boolean values. Declare the item type and item constraints in items.
Use minItems and maxItems on the array to limit its size. For unique selections from a fixed list, combine items.enum with uniqueItems: true.
A primitive array can declare a default array whose values match the item type. Defaults initialize missing values without replacing saved values.
This example declares a list of labels and a selection of event names:
Entity Arrays
For multiple entity selections, declare the entity type in items.x-entity:
In scripts, ctx.settings.reviewers is a YouTrack API Set of users. Use ctx.settings.reviewers.size to count the selections.
Object Arrays
Use an object array when each configuration item needs several fields. Declare each field and its type in items.properties.
Fields can contain primitive values, secrets, YouTrack entity references, or nested objects. A row can also contain a nested object array.
Use required in the item schema to require fields in each row. This example requires a name and a URL for every destination:
Object arrays are subject to the configuration row limit.
For row identifiers and saved-secret preservation in REST updates, see Object Array Rows in REST.
Nested Object Arrays
An object-array row can contain one level of nested object arrays. The nested array must be a direct property of the outer row and contain ordinary objects.
For example, each trigger can have several endpoints, each with its own secret. In each row schema, required names mandatory fields. Combining required with minItems: 1 requires at least one endpoint per trigger:
For example, triggers[].endpoints[] is supported, but triggers[].endpoints[].retries[] is not. Nested primitive arrays, nested entity arrays, and arrays inside a row's nested object are not supported.
Array Limits
These limits apply to arrays stored as app settings. JavaScript arrays created in scripts or widget code follow normal language behavior.
- Array Size
Each global or project configuration can contain at most 1,000 object-array rows in total. The limit includes all object-array settings and their nested rows. An outer row with three nested rows counts as four rows. Primitive arrays and entity selections do not count toward this total.
The
maxItemsconstraint limits each array separately. For object arrays, a lowermaxItemsfurther restricts the number of rows in that array.- Item Types and Nesting
Use one
itemsschema for all items. Tuple-styleitemsdeclarations and arrays whose items are arrays are not supported.Only one level of nested object arrays is supported, declared directly as a row property. Nested primitive arrays, nested entity arrays, and arrays inside a row's nested object are not supported. For an example, see Nested Object Arrays.
Primitive array items cannot use
format: "secret". Use secret fields in object-array rows for a list of secrets.
- Object Row Schemas
Declare row fields directly with
properties:Row schemas and their fields cannot use
$ref,allOf,anyOf,oneOf,patternProperties, or a schema-valuedadditionalProperties. UseadditionalProperties: falseto reject undeclared fields.Field names cannot be empty.
The
$itemIdrow identifier is reserved. YouTrack supplies it in REST settings data; do not declare it as a row field.
Project Overrides for Arrays
When a setting supports global and project configuration, a project override replaces the entire array. An empty project array [] also replaces the global value. Rows from global and project arrays are not merged.
If there is no project override, the project inherits the global array. For object arrays containing secrets, apply the rules in Secrets in Array Items before creating an override.
Secrets in Array Items
Use "type": "string", "format": "secret" for a secret field in an object-array row or nested row. Each row stores its secret independently.
In scripts, pass a row's secret value directly to the supported http methods, as with a top-level secret setting.
For row identifiers and saved-secret preservation in REST updates, see Object Array Rows in REST.
Use Array Values in Scripts
Read primitive and ordinary object arrays through ctx.settings.<settingName>. Use length, indexed access, and array methods such as forEach. Entity-array settings use the Set API, including its size property.
Changing array membership or ordinary row fields in memory does not save configuration changes. Use the settings form or REST configuration to save values. Entity references still expose the corresponding YouTrack entities.
For collection conversion and entity-reference behavior, see Arrays and Collections.
For the nested trigger settings, this function sends a request to each endpoint for a matching event:
Object Array Rows in REST
In REST settings responses, YouTrack adds a $itemId field to each saved object-array row. Its value identifies the stored row during edits and reordering. You do not declare this field in the row schema, and it is not exposed through ctx.settings.
Nested rows have their own $itemId, just like outer rows. The settings form retains row identifiers automatically to preserve saved secrets during edits.
When updating rows through REST, retain the returned $itemId for every existing row. Omit this field for a new row.
For secret fields, the <***> mask preserves a saved secret only for the same row in the same configuration. A nested row must also remain under the same parent row. For a new row, provide the actual secret value or omit the field if it is optional.
Settings Schema Reference
Use these fields and parameters when declaring settings in settings.json. The supported setting types and array shapes also determine what YouTrack can store.
Root Fields
Field | Type | Description |
|---|---|---|
| string | The schema root type. Use |
| string | An optional title displayed above the settings form. |
| string | An optional description displayed with the settings form. |
| object | Named setting declarations. Each value is a setting schema. |
| Array.<string> | Keys of required settings. See Required Settings and Defaults. |
Setting Parameters
The following parameters describe an individual setting. Use supported JSON Schema Draft 7 constraints together with the YouTrack-specific parameters.
Parameter | Type | Description | Required |
|---|---|---|---|
| string | The setting type. | ✓ |
| string | The field label displayed in the settings form. |
|
| string | Additional information displayed with the field. |
|
| Depends on the setting type | The initial value for an ordinary string, integer, number, boolean, or primitive array. See Required Settings and Defaults. |
|
| Array.<any> | A fixed list of allowed values. |
|
| any | The only allowed value. |
|
| string | A string format. Use |
|
| number | The inclusive lower bound for an integer or number. |
|
| number | The inclusive upper bound for an integer or number. |
|
| number | The exclusive lower bound for an integer or number. |
|
| number | The exclusive upper bound for an integer or number. |
|
| integer | The minimum string length. |
|
| integer | The maximum string length. |
|
| object | Required for array settings. Defines the schema for every item. See Arrays. | For arrays |
| integer | The minimum array size. Set to at least |
|
| integer | The maximum array size. Object arrays also have a configuration row limit. |
|
| boolean | When |
|
| boolean | When |
|
| string | The YouTrack entity type for an object-typed value. For entity arrays, declare it in | For entity references |
| string | The configuration scope: |
|
Setting Scopes
The optional x-scope parameter restricts where an individual setting can be configured:
Declaration | Configuration Behavior |
|---|---|
No | The setting can be configured globally and for individual projects. A project value takes precedence. Without a project value, the setting inherits the global value. |
| The setting can be configured only globally. |
| The setting can be configured only for individual projects. |
Changing a global value updates the effective value in projects that inherit that setting. Project overrides are independent for each setting.
Sample Settings File
This file combines text, numeric, and boolean settings with scopes, a secret, and entity selections. Array-specific examples are provided in Arrays.