Developer Portal for YouTrack and Hub Help

Connect to an External Tool

Here you will learn how to establish a connection from YouTrack to an external tool where you'd like to import data from. You will find an example of how to code the connection in your import script.

The import script uses the data you enter in the import configuration dialog to establish a connection.

Connection Example

Here is a basic example of how to connect to the import source using values entered in the import configuration dialog. Include this code in your custom import script to establish a connection to the external tool you want to import data from.

const params = context.parameters; const url = params.loadValue('url'); const sslKeyName = params.loadValue('sslKeyName'); const token = params.loadValue('password'); const connection = new http.Connection(url, sslKeyName) .addHeader('Authorization', 'token ' + token);

The parameters in this example correspond to the values you enter when setting up an import in the main Youtrack UI.

Connection Parameters

Here is the list of the parameters that you enter in the import configuration dialog along with their names that you may use to establish a connection to the import source.

Parameter name

Description

url

The URL of the import source.

sslKeyName

The name of the SSL key if it is selected. The SSL key is required when the import source requires client SSL authentication.

login

The username or the login that is used to log in to the import source. In many cases, the token already has the username information in it, which makes using this parameter unnecessary.

password

The password or the token for the account that is used to log in to the import source.

Last modified: 7 November 2024