• 製品
  • 使用を開始する
  • 関連ドキュメント
  • リソース

Schedule an import of your data

Assets Data Manager for Jira Service Management Cloud is currently rolling out in Open Beta and will be available to all Premium + Enterprise sites by end of October 2024.

 

The instructions below are for setting up a scheduled task to import data into Data Manager using third-party scheduling apps and the Cleanse and Import client.

The two apps used for demonstration are Cron (for MacOS/Linux) and Windows Scheduler (for Windows/DOS), but any scheduling app may be used as long as the command running the Cleanse and Import client is correctly configured.

ファイルをサーバーに配置して使用するプロセスがある場合、ファイルを適切な場所にコピーしてクレンジングとインポート クライアントが使用できるようにするために、追加のスケジュール タスクが必要になる場合があります。

You should leave an appropriate amount of time (1 hour) between scheduled tasks to allow them to complete.

Import your data using the Cleanse and Import client with a Cron job in MacOS and Linux

前提条件

To create a Cron job to run the Cleanse and Import client:

  1. Mac の Finder アプリ ([アプリケーション] > [ユーティリティ] > [ターミナル]) に移動して、コマンド ライン インターフェイスを開きます

  2. Navigate to the location of the Cleanse and Import client.

    1 cd ~/jsm-data-manager-clients/Assets.Importers.Client.app
  3. Create a new script to run the Cleanse and Import client. Make a new .sh file using a text editor like Nano. The example below creates a file named test-script.sh:

    1 nano test-script.sh
  4. Now enter the command that runs the Cleanse and Import client. You will need both your WorkspaceID and a Cleanse and Import token. Here’s a sample script:

    1 2 3 #!/bin/bash echo "This is an sample Bash script that runs the Importers client." ./Assets.Importers.app --workspace-id <workspaceId> --token <your-token> –-run <full>

Use double quotes (“) to wrap the name of the job, particularly when there are spaces in the task name. 

  1. Save the script.

  2. Make the script executable using the chmod command.

    1 chmod +x test-script.sh
  3. Next, open the Crontab file by typing the following: The file opens in the vi editor. If the crontab had not previously existed, a new file is created.

    1 crontab -e

To schedule a job for a different user, add the -u option: crontab -u [username] -e

  1. Add a line containing a Cron expression and the path to the script:

    1 [cron-expression] [path-to-script]

    A Cron expression consists of five fields that accept the respective number values:

    1 [minute: 0-59] [hour: 0-23] [day: 1-31] [months: 1-12] [weekday: 0-6]

The zero in the weekday field stands for Sunday, one for Monday, two for Tuesday, etc.

The syntax also allows the following special characters:

  • (*) includes all values.

  • (/) divides the value into steps. For example, */2 in the day field means "every second day."

  • (-) allows creating a range of values. For example, 1-3 in the month field means "from January to March."

  • (,) specifies individual values, for example, 1,3 in the weekday field means "on Monday and Wednesday."

  1. Press i to turn on the Insert Mode.

  2. Add the following line to the crontab file to run our test script every Tuesday and Thursday at 6 p.m.:

    1 0 18 * * 2,4 /Users/[username]/test-script.sh
  3. Press ESC to leave insert mode.

  4. Save the file and exit by pressing the colon : and then x to save the edits to your crontab.

  5. You can view your list of existing cron jobs using the crontab command. The output displays all the previously added Cron expressions.

    1 crontab -l

Import your Data using the Cleanse and Import client with Windows Scheduler in Windows/DOS

前提条件

Windows タスク スケジューラクレンジングとインポート クライアントを実行するタスクを作成するには、次の手順に従います。

  1. Windows タスク スケジューラを開く

  2. データ マネージャー」というサブフォルダーを作成します。

  3. Select Create Task from the right pane, and you are presented with the Create Task box

  4. Enter the name of the task, which should be meaningful for the job to be done. In this example, we’ll use Test, but a more suitable name could be “Import JSM Assets.”

  5. ラジオ ボタン [ユーザーがログオンしているかどうかにかかわらず実行する] を選択します。

  6. Select Change User or Group and enter the service account details. 

Typically, a Service account is used to execute the job. A service account has the advantage of not being tied to an individual, so the account’s password remains static, and it can run as a batch.

  1. Select the Trigger tab and select New….

  2. Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start, etc).

  3. [OK] を選択します。

  4. Select the Action tab and select New…

  5. [操作:] が [プログラムの開始] に設定されていることをご確認ください。

  6. Enter the Program/script as assets.importers.client.app.exe.

  7. You must enter the following in the Add arguments (optional) field:

    1. [トリガー] タブをクリックし、[新規…] をクリックします。

    2. Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start etc).

    3. OK をクリックします。

    4. [アクション] タブをクリックし、[新規…] をクリックします。 

    5. [操作:] が [プログラムの開始] に設定されていることをご確認ください。

    6. Enter the Program/script as assets.importers.client.app.exe.

    7. You must enter the following in the Add arguments (optional) field:

      1. [トリガー] タブをクリックし、[新規…] をクリックします。

      2. Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start etc).

      3. OK をクリックします。

      4. [アクション] タブをクリックし、[新規…] をクリックします。 

      5. [操作:] が [プログラムの開始] に設定されていることをご確認ください。

      6. Enter the Program/script as assets.importers.client.app.exe.

      7. You must enter the following in the Add arguments (optional) field:

        1. [トリガー] タブをクリックし、[新規…] をクリックします。

        2. Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start etc).

        3. OK をクリックします。

        4. [アクション] タブをクリックし、[新規…] をクリックします。 

        5. [操作:] が [プログラムの開始] に設定されていることをご確認ください。

        6. Enter the Program/script as assets.importers.client.app.exe.

        7. You must enter the following in the Add arguments (optional) field:

          1. You must specify the WorkspaceID, for example:

            1 --workspaceid e44regc98-8d2r-3af7-011t-209p44716366
          2. You must specify the Cleanse and Import Client token, for example:

            1 --token ATCTT3xFrTN0U64VR99p1VfpQtLlpar7R4hq6PSkiNNaNOyk37P_7URVmROOp1Orez-ijlluMRwJA7Cw1LsgMFqFnvhJapdniv4ewDc0twt7vPBhrbDts1fyPOW6Tw3S-Gzg6rRaEULWl2_JqQNvictFu_hK6wGxpGRvPTpyaQXzr9MtQ_8yKDms=0433HC52
          3. You must specify if you want to Cleanse, Import, or run both operations at the same time:

            1 2 3 --run import --run cleanse --run full

Use double quotes (“) to wrap the name of any data sources, particularly when there are spaces in the task name. 

  1. The Start in (optional): field is where the Data Manager client executable resides in the server (refer to the prerequisites). Specify the destination folder where the Data Manager client resides:

    1 c:/jsm-data-manager-clients/node-modules/@data-manager-packages/production-win-x64/Assets.Importers.Client.win-x64/Assets.Importers.App.exe
  2. [設定] タブ内をクリックします。

  3. [タスクを停止するまでの時間] を [3 日間] から [1 時間] に変更します。

  4. OK をクリックします。

  5. サービス アカウントを使用してタスクを開始すると、サービス アカウントのパスワードを入力するよう求められます。対応するパスワードを入力して、[保存] ボタンをクリックします。

The task is now saved and can be executed from the task scheduler, it will be ran at the time defined in the above steps. The scheduled tasks can be tested by selecting the Task Name and selecting Run.

 

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。