Connection scripts
Connection scripts allow you to automate your actions on existing connections.
Start and stop scripts
The following scripts allow you to start and stop your connections.
If the script contains a placeholder value, for example, ConnectionName, you must edit it in a text editor and replace the placeholder value with your own value.
Tip: To retrieve a list of your connection names, run mfcQueryStatus.bat script in the Utilities folder. From the generated list, copy and paste the exact name of the connection into your script.
Script name | Arguments | Description |
---|---|---|
StartAllConnections |
pauseBetweenSynchronizationsRuns. Delay time before starting connections. TimeLimit. The amount of time the process will run or monitor the starting of all connections. Example:
|
Starts all connections. |
StopAllConnections |
executionTimeLimit. The amount of time the process will run or monitor the stopping of all connections Example: |
Stops all connections. |
StartConnection |
ConnectionName. The name of the connection that you want to start (case-sensitive), as displayed in the connection list. executionTimeLimit. The amount of time the process will run or monitor the starting of the specified connection. Example:
|
Starts the specified connection. |
StopConnection |
ConnectionName. The name of the connection that you want to stop (case-sensitive), as displayed in the connection list. executionTimeLimit. The amount of time the process will run or monitor the stopping of the specified connection. Example:
|
Stops the specified connection. |
Connection management scripts
The following scripts allow you to manage your connections.
If the script contains a placeholder value, for example, ConnectionName, you must edit it in a text editor and replace the placeholder value with your actual connection name. To retrieve a list of connection names, run mfcQueryStatus.bat. From the generated list, copy and paste the exact name of the connection into your script.
Script name | Arguments | Description |
---|---|---|
RunOneIteration | - |
Runs a single iteration of the connections defined in the syncset, in sequence—not simultaneously. This capability helps you prevent the exceeding of your network bandwidth and limitations on the source and target endpoints. |
DeleteConnection | ConnectionName The name of the connection that you want to delete (case-sensitive), as displayed in the connection list. |
Deletes the specified connection. Replace the placeholder variable, ConnectionName. Caution: After a connection is deleted, all synchronization cross-references associated with this connection are also removed. |
MergeConnections |
|
Merges two connections into a single connection. You can merge two connections that have the identical master and target data sources. The script merges the types, projects, synchronization criteria, calculated values and cross references. The new connection is created in a disabled state. After your verify that the resultant connection was created correctly, delete the old connection and enable the new one. |
RenameConnection |
|
Renames an existing connection. For example: |
ClearWaterMarks script
Watermarks are added to indicate what was already synchronized. They act as a time and place marker so that the connector can compare what was updated, added, or deleted after the previous watermark was generated.
The ClearWaterMarks script resets the watermarks for all active connections.
Resetting watermarks forces a full synchronization by each connection on the first iteration after the server restarts.
You can add parameters to the script to achieve the following results:
Parameter | Result |
---|---|
removenulls |
Removes all cross references from the database, whose source or target value is null. |
removemismatches |
Removes all matched pair cross references, where either the source or the target value is in the database but not in the corresponding endpoint product. The script targets the following endpoints only: ALM Octane, ALM/QC, Jira, Azure DevOps, Version One, Rally, or ServiceNow. |
(no parameter) |
Clears all the watermarks for all connections. |
For details about resetting watermarks from the user interface, see Reset watermarks.
Cross Reference scripts
The following scripts allow you to copy cross references accurately between syncsets. Using these scripts, you can avoid having to manually export the cross references template of the target connection, set up cross references in the template, and import them one syncset at a time. When working with a large number of syncsets, manual exports and configurations are prone to errors.
CopyXrefs
The CopyXrefs script copies cross references from a common projects-based connection to a corresponding type-specific projects connection. For details on common projects and type-specific projects, see Add projects and rules to a connection.
The script includes two variables: SOURCE_CONNECTION and TARGET_CONNECTION.
Replace the values with the exact, case-sensitive names of the corresponding connection names, as displayed in the connection list..
ImportXrefs
The mfcImportXRefs script imports all cross references from an exported cross reference file to an identical connection. It imports the cross references across all types and project pairs described by the exported XML file.
The script includes two variables: CROSS_REFERENCE_XML_FILE_NAME , in the usermaps folder, and TARGET_CONNECTION.
Replace the values with the exact, case-sensitive names of the corresponding cross reference XML file and connection name, as they appear in the user interface.
A common use case for this utility is copying a connection from one Connect instance to another.
To copy a connection:
-
Perform an export of the first Connect instance to generate a Connection.xml. For details see Import, export, and back up data.
-
Export the cross references from the first Connect instance.
-
Import the connection file Connection.xml into the second Connect instance. You may want to rename the XML file before you import it, to allow you to differentiate between the XML files.
-
Copy the cross references XML file to the machine running the second Connect instance.
-
Run the script mfcImportXRefs.bat|sh.
See also: