Connect field values are incorrect after migration


Table of contents



Symptoms

After migrating Jira issues using Configuration for Jira (CMJ), the values of some Connect fields may no longer be valid.

This problem occurs when Connect fields store the Issue or Option IDs as keys.

This is the case when:

  • The Connect field is connected to the preconfigured datasource "Jira issues (JQL)", whose key is implicitly an Issue ID.
  • The Connect field is connected to the Jira database and stores Issue/Option IDs, as follows:



Cause

This problem occurs because the source and target Jira instances are not clones of each other. As a result, the IDs they contain are different (project IDs, issue IDs, option IDs, etc.). 

So, when you migrate a Connect field with a certain Issue ID in the source Jira instance, this ID doesn't exist or doesn't refer to the same issue in the target instance. As a result, the migrated connect field values are irrelevant.



Resolution

Two possible workarounds

There are two possible workarounds:

  • 1st workaround: Either you change the Connect field keys so that they no longer store Issue/Option IDs.
  • 2nd workaround: Or you don't change the Connect field keys, but you inject values common to both instances in a text field (for example, for the issue ID, the issue-key is the same between both Jira instances) and update the Connect fields in the target instance according to this text field.

Pros and cons

 Pros

Cons

1st workaround

(click here)

  • Better solution if multiple migrations have to be performed (it allows successive migrations to be carried out).
  • More complex.
  • Not recommended if the Connect field queries are complex. The new resulting queries may be even more complex and lead to performance issues.
  • Scripts based on these Connect fields will also need to be updated.

2nd workaround

(click here)

  • Easier solution.
  • The Elements Connect configuration will not change.
  • The whole procedure will have to be repeated for each migration, so this may be cumbersome if multiple migrations have to be carried out.

Requirements

For each workaround, the third-party application called Scriptrunner for Jira must be installed on your Jira instance.