Define calculated values

Calculated Values are field values that will be automatically set during synchronization if certain conditions are met. For example, you can define a rule that, when the connection creates a new story, its Tested value will be set to "false”.

Add a calculated value

You add a calculated value in the Connection Rules window.

To add a calculated value:

  1. In the Connection Rules window, choose a type and click Add Type Rule.
  2. In the Connection Type Rule dialog box, select the Calculated Values tab for either the Target or Master.
  3. Click the Add Calculated Value button. The Add Calculated Value window opens:

  4. Specify the When query. The When query determines the condition that an asset must meet in order for the calculated value to be applied. For details on specifying the When query, see Add projects and rules to a connection.

    Note: If you do not specify a When query, then the Calculated Value will always be applied when an asset is synchronized.

  5. In the Set Field drop down, choose the field whose value you want to set.

  6. In the To Value field, specify the value that you want to assign to the field. Use one of the following options:

    • Type a static value ("123"), or choose a value from the dropdown list ("Open").
    • For reference fields, you can set the value using one of the Find functions. These functions will discover the item according to the criteria you specify. Enter a function and define a From query. For a list of available functions, see Functions.
    • For date fields, you must use the long date format with an offset specifier:
      YYYY-MM-DDTHR:MIN:SEC+/-OFFSET.
      For example, 2016-01-01T00:00:00+00:00. Other formats will result in an error.
  7. If you entered a function in the To Value field, define a From query. For details, see Add projects and rules to a connection.

  8. Click OK to save.

Back to top

Synchronize reference fields

You can use Micro Focus Connect to synchronize reference fields, by creating linkage to the referenced entity.

For example, suppose you are synchronizing a Jira project with an ALM Octane workspace. The Jira bugs and ALM Octane defects have a Release field. In ALM Octane, the Release field is a reference field, meaning that its value is linked to a release entity in the workspace. When creating a defect in ALM Octane, Micro Focus Connect can populate the Release field with the appropriate value, and also link the value to an existing release entity in ALM Octane.

To create a link between reference fields in the Set Field section, you can use the FindFirst functions. These functions search for an item in the product's database that matches the criteria defined in the From section. For details, see Functions.

To find the matching release, you must refer to the field value in the item being synchronized. To do so, use the My->fieldName or Other->fieldName variables.

  • Use My->fieldName to refer to the product for which you are creating the calculated value—target or master.
  • Use Other-> fieldName to refer to the product on the other end of the synchronization.

Note: For fieldName, specify the field's system name—not the field's label.

The following example demonstrates synchronizing the Release field in an ALM Octane defect:

For other examples using functions and variables, see Calculated value examples.

Back to top

Functions

You can dynamically set field values using functions. Functions are usually used in combination with values or variables in the From area.

Function Result
Max(type, property) The largest of a set.
Min(type, property) The smallest of a set.
FindFirst(type) The first in a set that satisfies the find criteria.
FindAll(type) Returns all in a set that satisfy the find criteria.
FindFirstOrThrow(type) The first in a set that satisfies the find criteria. Returns an error if not found.
FindAllOrThrow(type) Returns all in a set that satisfy the find criteria. Returns an error if not found.
FindFirstInProperty(syncItemProperty) The first in a set that satisfies the find criteria, looking only at the SyncItems in the given property.
FindAllInProperty(syncItemProperty) Returns all in a set that satisfy the find criteria, looking only at the SyncItems in the given property.
FindFirstInPropertytOrThrow(syncItemProperty) The first in a set that satisfies the find criteria, looking only at the SyncItems in the given property. Returns an error in not found.
FindAllInPropertyOrThrow(syncItemProperty) Returns all in a set that satisfy the find criteria, looking only at the SyncItems in the given property. Returns an error if not found.
csv(type) A comma-separated string of the values.

Back to top

See also: