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 - Starts all connections.
StopAllConnections - Stops all connections.
StartConnection ConnectionName The name of the connection that you want to start (case-sensitive), as displayed in the connection list.

Starts the specified connection.

StopConnection ConnectionName The name of the connection that you want to stop (case-sensitive), as displayed in the connection list.

Stops the specified connection.

Back to top

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
  • ConnectionName1, ConnectionName2The names of the connections that you want to merge (case-sensitive), as displayed in the connection list.
  • ConnectionName3: A name for the merged connection.

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.

Back to top

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.

Back to top

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 Micro Focus Connect instance to another.

To copy a connection:

  1. Perform an export of the first Micro Focus Connect instance to generate a Connection.xml. For details see Import, export, and back up data.

  2. Export the cross references from the first Micro Focus Connect instance.

  3. Import the connection file Connection.xml into the second Micro Focus Connect instance. You may want to rename the XML file before you import it, to allow you to differentiate between the XML files.

  4. Copy the cross references XML file to the machine running the second Micro Focus Connect instance.

  5. Run the script mfcImportXRefs.bat|sh.

Back to top

Rename

Use the Rename script to rename either a connection or data source.

In the script, provide values for the following variables:

Variable Possible values
ARTIFACT "connection" or "datasource"
OLD_NAME The current name of the connection or data source that you want to rename.
NEW_NAME The new name for the connection or data source.

Naming guidelines: 

  • Avoid using white spaces. Use underscores instead.

  • Avoid using Windows special characters: / \ : * < > |

This script stops the Micro Focus Connect server, changes the name, and restarts the server.

Back to top

See also: