Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
panelIconIdatlassian-info
panelIcon:info:
panelIconText:info:
bgColor#F4F5F7

This page is about Assets & Inventory Plugin for Jira DC. Using Cloud? Click here.

This guide explains how to import assets and keep them synchronized with a database or

...

Configuration Management Database (CMDB) tool.

...

Database synchronization definition can be made from External System Configuration tab which is under the Settings menu.

Image Removed

Image Removed

...

Specify a name for your configuration.

...

The URL to connect to the database.

...

On this page:

Table of Contents
minLevel1
maxLevel6
outlinefalse
styledefault
typelist
printabletrue

Set up database synchronization

  1. Navigate to Settings > External System Configuration.

  2. Click Add Database Configuration.

  3. Define the connection details.

    Image Added
  1. Name: Enter a recognizable name for this configuration (for example, Production Database).

  2. URL: Provide the database connection URL. Refer to your database provider's documentation for specific URL formats (for example, PostgreSQL: jdbc:postgresql://localhost:5432/jira8.5.1).

  3. Driver

...

  1. : Specify the JDBC driver class required to connect to

...

  1. your database.

Please do not forget to place JDBC driver (*.jar) to <Jira Installation Directory>/lib folder

    • Download the appropriate driver JAR file.

    • Place the JAR file in the Jira installation directory under the lib folder.

    • Restart Jira for the changes to take effect.

Database

Driver

...

Class

Description

Microsoft SQL Server

com.microsoft.sqlserver.jdbc.SQLServerDriver

MySQL

com.mysql.jdbc.Driver

com.mysql.cj.jdbc.Driver

Connector/J version 5.1

Connector/J version 8

See https://dev.mysql.com/doc/connector-j

...

/en/connector-j-versions.html for more information.

PostgreSQL

org.postgresql.Driver

Oracle

oracle.jdbc.OracleDriver

  1. User

...

  1. : Enter the username with access to the database.

  2. Password

...

Authorized user password.

Password will be kept as encrypted.

...

  1. : Provide the password for the specified user. (Note: Password is encrypted during storage. Anytime you want to edit a configuration, you must enter the password again.)

  2. Cron Expression

...

  1. : Schedule synchronization using a cron expression (for example, 0 0 * * * for daily sync at midnight).

  2. Acting Jira User

...

  1. : Select a Jira user with permissions to

...

  1. create, update, and delete

...

  1. assets.

  2. Is Active

...

  1. : Enable or disable synchronization for this configuration.

  2. Test Connection

...

  1. : Verify the connection details by clicking Test Connection

...

  1. .

  2. Click Save.

Asset Type

...

You can reach the Asset Type Mapping configuration page by configuring a created database configuration.

Image Removed    Image Removed

Image Removed

...

mapping

  1. Click Assets > Settings > External System Configuration.

  2. After creating a database configuration, select its name.

  3.  Click Configure to access the mapping options.

  4. Define mapping details.

    Image Added
  5. Name: Assign a descriptive name for this mapping (for example, Import Servers).

  6. Asset Type: Select the Jira asset type you want to populate with data from the database.

  7. Selector: The selector is an SQL query. Write an SQL query to retrieve data from your database table. You can test and refine these queries directly in a database client tool. Data will be fetched from this execution result.

Database

Example

Microsoft SQL Server

...

Select * FROM Northwind.dbo.Customers

MySQL

SELECT * FROM employees

Oracle

SELECT * FROM products

PostgreSQL

SELECT * FROM

...

“inventory_

...

example”

Additional columns (not on the table)

...

You can add constant values to the query or database functions to add calculated values as columns. For example

...

, you can add status and substatus static values to the query where they are not in the table.

select

...

t.*,

...

'In

...

stock'

...

as

...

c_status,

...

'Available'

...

as

...

c_substatus

...

from

...

assets.t_service_category

...

t

Info

Notes:

  • Please try SQL queries on a database client first.

...

  • Consider database schema requirements (tables or views) before defining selectors.

  1. Date Format

...

  1. : Specify date formats (for example, yyyy-MM-dd for 1994-01-17

...

  1. ) if your database stores these values in character fields. Refer to https://docs.oracle.com/javase/

...

...

  1. formatting options.

  2. Date Time Format

...

  1. : Specify date-time formats (for example, yyyy-MM-dd hh:mm:ss.s for 1994-01-17 09:00:00.0

...

  1. ) if your database stores these values in character fields. Refer to https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html for

...

  1. formatting options.

  2. Delimiter

...

  1. : If multiple values are kept in a

...

  1. character field, a delimiter (for example, comma) will split them while importing. Delimiter provides importing multiple select attributes like Checkbox

...

  1. and List Box - Multiple.

  2. Define Non-Existing Attribute Options

...

  1. : When the imported value is not an option for the attribute, this option

...

  1. allows you to define these values as a new option for attributes like Checkbox, Dropdown List, List Box, List Box - Multiple, and Radio Button.

  2. Ignore Attribute Existence

...

  1. : When an attribute is not defined in

...

  1. the Asset Type Schemes of the selected Asset Type, this option allows the asset to be created without undefined attribute value. Otherwise, the asset will not be created.

  2. Delete Missing Objects

...

  1. : This option provides full synchronization with the database. If

...

  1. enabled, the synchronization system will delete the manually created assets (the assets

...

  1. that are not imported from the database) in the selected

...

  1. Asset Type.

  2. Update Multiple Objects

...

  1. : Identifiers provide the Asset Uniqueness. When multiple assets are found with the identifier search, this option decides

...

  1. whether all found assets will be updated or

...

  1. none of them.

  2. Ignore Empty Values

...

  1. : Prevent empty values from being imported.

  2. Ignore Invalid Values

...

  1. : When an imported value is not invalid for an attribute, the asset will not be created. With this option, the asset will be created without the attribute, which

...

  1. has an invalid value.

  2. Is Active

...

  1. : Enable or disable synchronization for this specific Asset Type Mapping.

...

  1. (Note:

...

  1. Asset Name Field Mapping

...

Field Mapping

Field Mapping is for the map attributes with database columns.

Image Removed

Image RemovedImage RemovedImage Removed

...

The Column which you want to get data. Columns are fetched from the database.

Please be sure the connection with the database is successful.

...

It is possible to define different delimiters for different attributes.

This field available for Asset List, Asset List By Form, Checkbox, List Box - Multiple, Jira Multiple Users attributes. 

...

The concatenator is for the concatenate more than one query columns.

Example: 

Assume that for an Employee asset type, the asset name field needs to imported from two different columns like first_name and last_name

and concatenator is defined as "-". The asset name field will be imported as First-Name.

...

The identifier is to search if the imported asset is existing in the system. If asset exist, the asset will be updated.

Otherwise, new asset will be created.

...

  1. must be defined for activation.)

  2. Click Save.

Field mapping

This allows you to define how data from your database columns will be used to populate attributes in your assets.

  1. Navigate to Assets > Settings > External System Configuration.

    Image Added
  2. Go to the database configuration you’ve created, and expand it.

  3. Click Create new Field Mapping.

  4. Define mapping details.

    Image Added
  5. Attribute Name: Select the Jira asset type attribute you want to import data for.

If Asset List or Asset List by Form is selected as

...

Attribute, these fields will

...

appear:

  • Referenced Asset Match Type

...

  • : Decide which way to fill asset list fields.

If the Match with Query Column

...

is selected:

Image Added
  • The asset name search will be held with the imported value.

...

  • For

...

  • example, referenceAssets("asset.name", "imported value")

...

  • .

  • When Multiple Asset Found, Match

...

  • : With the given parameters, if multiple assets are found in the search result, decide match:

          ALL: References all found assets

          FIRST: References the assets with the lowest ID

          NONE: References none of them

  • Query/Scripted Column

...

  • : With this field, it is possible to find the assets

...

...

  • Each line is accepted as a different search. Each search result will be referenced on

...

  • the Attribute.

    Code Block
    referenceAsset("asset.name", "${asset_name}", "Country", "Turkey", "City", "${city})
    referenceAssetByType("Employee", "asset.name", "${asset_name}")To perform an EXACT query, surround the variable with an escaped double quotes: "\"${c_emp_id}\""For example:Search ScriptCurrent row valueAssets to match matchreferenceAssetByType("Employee", "Employee ID", "${c_emp_id}")Emp 001Emp 001Emp 002referenceAssetByType("Employee", "Employee ID", "\"${c_emp_id}\"")Emp 001Emp 001

...

  • The value between "${}" must be the name of the column of the database from where you get the search parameter.

For example:

Tip

Example:

The referenceAsset() function in the first line of the Scripted Column

...

retrieves the asset.name and City fields

...

from the

...

"asset_name" and

...

"city" columns in the database.

If the Match with Scripted Column is selected:

Image Added
  1. Query Column: Choose the column containing the data to import.

Note

Columns are fetched from the database, so ensure the connection with the database is successful.

  1. Delimiter: Define a delimiter (if needed) to separate multiple values imported into list-based attributes. This field is available for Asset List, Asset List By Form, Checkbox, List Box - Multiple, and Jira Multiple Users attributes. 

  2. Concatenator: Use this to combine data from multiple database columns into a single attribute value in Jira.

Tip

Example:

For an Employee asset type, the asset name field needs to be imported from two different columns first_name and last_name. The concatenator is defined as -. In this case, the asset name field will be imported as First-Name.

  1. Is Identifier: This searches if the imported asset exists in the system. If the asset exists, it will be updated. If not, a new asset will be created.

  2. Click Save.