Database Import Shell Properties

Database import shell property accessors are defined when importing data from a generic ODBC database.

Shell.ImportAction()

string (input). Specifies the operation of the data import on the current item. Possible values are add (add a new item) and update (update an existing item).

Shell.ImportCommand()

int (output). Applies a command to the currently running script. Possible values are:
  • 0 (Continue) – The default value, which allows the data import to continue running.
  • 1 (Bypass import Item) – Stops all actions on the current item and moves on to the next item. The current item will not be added or updated if this value is set.
  • 2 (Kill Import) – Stops the data import for all items.

Shell.ImportID()

int (input). ID of the current Import Option Set record.

Shell.ImportLog()

TSLog object (input/output). The TSLog object is a complex object used to log messages into the DBImport log file. The logging levels defined in the TSLog object are minimal, average, and verbose. The message function defined in the TSLog object logs messages directly into the DbImport log using the following syntax:

Message ( Logging Level ( Int ), Message ( String ) )

For example:

var Log = Shell.ImportLog();
Log.Message ( Log.MINIMAL, "Message Logged at Minimal Logging Level" );
Log.Message ( Log.AVERAGE, "Message Logged at Average Logging Level" );
Log.Message ( Log.VERBOSE, "Message Logged at Verbose Logging Level" );

Shell.ImportName()

string (input). Name of the current Import Option Set record.

Shell.Source()

dictionary (key(string), object (DbImport) (input).

Key

The key string contains the source column name and optionally the destination (SBM) field ID. Keys that contain only the source column name are unmapped source values available for processing via the script. All mapped keys will use the '.' as a separator followed by the SBM field database name. For example, issuetype.ISSUETYPE, state.STATE, title.TITLE, color.COLOR_SINGLE_SELECTION, issueid.ISSUEID, id.

The following example will iterate through all values contained within the Source Dictionary:

var source = Shell.Source();
for ( dbImport : source ) {
//do something with dbImport
}

Value

DbImport. DbImport is a class that contains values representing the source database values:

SrcColumn

string. The database column from the source database.

SrcType

integer. The database column type from the source database. The following database data types are supported:

SrcData

string/integer. The actual data from the source database.

SrcLabel

string. If an "Int" type value maps to a reference table, this string value represents the label from the source database.

DestFldId

integer. If mapped, this value represents the destination (SBM) field ID.

Shell.SourceDb()

AppDB object (input).The source database object.

Related Topics

Shell Property Descriptions

Shell Properties by Context