---
schema: rendered-html/v1
title: "Demo Import Script | Developer Portal for YouTrack and Hub Documentation"
source_url: https://www.jetbrains.com/help/youtrack/devportal/demo-import-script.html
generated_at: 2026-06-11T15:02:44.525113+00:00
---

Feedback

Thanks for your feedback!

Was this page helpful?

YesNo

Developer Portal for YouTrack and Hub

- Developer Portal
- Apps
- MCP Tools
- YouTrack Workflows
- YouTrack Import Scripts
- [Get Started with Import Scripts](jetbrains__com__help__youtrack__devportal__get-started-custom-import-scripts.md)
- [How Import Scripts Work](jetbrains__com__help__youtrack__devportal__how-import-scripts-work.md)
- [Imported Entities](jetbrains__com__help__youtrack__devportal__imported-entities.md)
- Working with Import Scripts
- [Demo Import Script](demo-import-script.html)
- Connect to an External Tool
- YouTrack Import API
- YouTrack Form API
- YouTrack REST API
- Hub REST API

1. YouTrack Import Scripts
2. [Get Started with Import Scripts](jetbrains__com__help__youtrack__devportal__get-started-custom-import-scripts.md)
3. [Demo Import Script](#0)

# Demo Import Script﻿

Last modified: 07 May 2026

In this article, we look closely at the demo script package, explain how it is built and what is the logic behind it.

## Demo Script Package﻿

To get an idea of how a custom import script works, have a look at the predefined demo import script package that is built in to your YouTrack.

### To open the demo import script package:﻿

1. From the Administration menu, select Integrations > Imports.
2. Click the New import button to open the setup dialog.

   [![New import dialog](https://crawler.prototype.prolicht.digital/l/LYzMKg)](https://resources.jetbrains.com/help/img/youtrack/custom-import-new-select.png)
3. Select Custom import.

   - The New Custom Import dialog opens.
4. Make sure that in the Import script package dropdown menu, the default `@jetbrains/youtrack-demo-client` script is selected.

   [![Select demo client](https://crawler.prototype.prolicht.digital/l/nHwuXw)](https://resources.jetbrains.com/help/img/youtrack/new-custom-import-settings-demo-client.png)
5. Click the customize import script link at the bottom of the page.

   - The web-based script editor opens with the demo script package expanded. To learn about working in the web-based script editor, see Web-based Workflow Editor.

The demo script package consists of five files. The main script file is named `client.js`. It contains the import logic and the API reference. Consult this file as an example of an import script.

The other four files contain hard-coded demo data in JSON format. This data is then converted into YouTrack entities when the demo import script is run.

[![Data for the demo client](https://crawler.prototype.prolicht.digital/l/QoJTn2)](https://resources.jetbrains.com/help/img/youtrack/demo-client-predefined-data.png)

These four files show you what attributes can be imported for issues, articles, projects, and users. Consult these files to learn which data format is expected from the import source.

## Demo Client Script﻿

Here you can find the content of the `client.js` file from the demo script package. For better readability, the content of the file is stripped of the API reference.

```
const demoIssue = require('./demo-issue').demoIssue;
const demoArticle = require('./demo-article').demoArticle;
const demoUser = require('./demo-user').demoUser;
const demoProject = require('./demo-project').demoProject;

class DemoClient {

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

    prepareToImport() {}

    getTimestampFormats() {
        return ['yyyy-MM-dd\'T\'HH:mm:ss\'Z\'', 'yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'', 'yyyy-MM-dd'];
    }

    getServerInfo() {
        return {
            version: 'demo',
            time: new Date().toISOString()
        };
    }

    getAttachmentContent(project, document, attachment) {
        return {
            data: '',
            metadata: {
                mimeType: 'image/jpeg'
            }
        };
    }

    getLinkTypes() {
        return [];
    }

    getProject(projectInfo) {
        return demoProject;
    }

    getProjects() {
        return [demoProject];
    }

    getIssues(projectInfo, after, top) {
        return [demoIssue];
    }

    getUsers(group, skip, top) {
        return [demoUser];
    }

    getIssueUpdates(projectInfo, after, updatedAfter, top) {
        return [demoIssue];
    }

    getUserTimeZoneId() {
        return 'Europe/London';
    }

    getArticles(projectInfo, after, top) {
        return [demoArticle];
    }
}

exports.Client = context => new DemoClient(context);
```

- [Demo Import Script](/help/youtrack/devportal/demo-import-script.html)
- [Demo Script Package](/help/youtrack/devportal/demo-import-script.html#demo-script-package)
- [Demo Client Script](/help/youtrack/devportal/demo-import-script.html#demo-client-script)

Working with Import ScriptsConnect to an External Tool

- Privacy & Security
- Terms Of Use
- Trademarks
- Legal

Copyright © 2000–2026 JetBrains s.r.o.
