Get started with Jira Service Management for admins
Your first stop for learning how to get started with Jira Service Management.
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.
If you have a process of placing the files on a server for consumption, additional scheduled tasks may be required to copy the files to the appropriate location for the Cleanse and Import client to consume.
You should leave an appropriate amount of time (1 hour) between scheduled tasks to allow them to complete.
Prerequisites
All data sources linked to the Object Class that you are importing must be mapped and cleansed.
The Cleanse and Import Client must also be installed, see Installing the Cleanse and Import Client.
To create a Cron job to run the Cleanse and Import client:
Open a command line interface by navigating to the Finder App in Mac (Applications > Utilities > Terminal).
Navigate to the location of the Cleanse and Import client. This may be in a different location depending on how you have set up your Data Manager Clients. The Cleanse and Import Client will have the following filename:
1
dm-cleanseimport.app
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
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."
./dm-cleanseimport --workspace-id <workspaceId> --token <your-token> –-run "import"
Use double quotes (“) to wrap the name of the job, particularly when there are spaces in the task name.
Save the script.
Make the script executable using the chmod command.
1
chmod +x test-script.sh
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
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."
Press i to turn on the Insert Mode.
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
Press ESC to leave insert mode.
Save the file and exit by pressing the colon : and then x to save the edits to your crontab.
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
Prerequisites
All data sources linked to the Object Class that you are importing must be mapped and cleansed.
The Cleanse and Import Client must also be installed, see Installing the Cleanse and Import Client.
To create a task in Windows Task Scheduler to run the Cleanse and Import Client:
Open Windows Task Scheduler
Create a subfolder called Data Manager.
Select Create Task from the right pane, and you are presented with the Create Task box.
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.”
Select the radio button "Run whether user is logged on or not".
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.
Select the Trigger tab and select New….
Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start, etc).
Select OK.
Select the Action tab and select New….
Ensure Actions: is set to Start a program.
Enter the Program/script as dm-cleanseimport.app.
You must enter the following in the Add arguments (optional) field:
Click on the Trigger tab and click on New….
Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start etc).
Click OK.
Click in the Action tab and click on New….
Ensure Actions: is set to Start a program.
Enter the Program/script as dm-cleanseimport.app.
You must enter the following in the Add arguments (optional) field:
Click on the Trigger tab and click on New….
Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start etc).
Click OK.
Click in the Action tab and click on New….
Ensure Actions: is set to Start a program.
Enter the Program/script as dm-cleanseimport.app.
You must enter the following in the Add arguments (optional) field:
Click on the Trigger tab and click on New….
Enter the details of when the job will be executed (daily, weekly, monthly, the time of day to start etc).
Click OK.
Click in the Action tab and click on New….
Ensure Actions: is set to Start a program.
Enter the Program/script as dm-cleanseimport.app.
You must enter the following in the Add arguments (optional) field:
You must specify the WorkspaceID, for example:
1
--workspaceid e44regc98-8d2r-3af7-011t-209p44716366
You must specify the Cleanse and Import Client token, for example:
1
--token ATCTT3xFrTN0U64VR99p1VfpQtLlpar7R4hq6PSkiNNaNOyk37P_7URVmROOp1Orez-ijlluMRwJA7Cw1LsgMFqFnvhJapdniv4ewDc0twt7vPBhrbDts1fyPOW6Tw3S-Gzg6rRaEULWl2_JqQNvictFu_hK6wGxpGRvPTpyaQXzr9MtQ_8yKDms=0433HC52
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.
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.
Click in the Settings tab.
Change the Stop the task if it runs longer than: from 3 days to 1 hour.
Click OK.
If the service account is used to initiate the task, you will be asked to enter the password for the service account. Enter the corresponding password and click on the SAVE button.
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.
Was this helpful?