You can sync Elements Connect fields versions 5.12 and lower.
Elements Connect (previously known as nFeed) is a Jira add-on allowing to integrate external information into the context of an issue. This information can come from databases, web-services or other sources.
For instance, it can be used to show customer information such as a telephone number, address and so on, which has been looked-up from a CRM database.
This add-on is particular in the way that the information is stored. Instead of storing the information which is showed in the issue, it only stores an identifier of that information allowing to lookup the actual values.
There are 2 challenges manipulating this data especially when each side of a synchronisation relation is using a different data store.
Looking up Elements Connect values
The challenge when synchronizing these custom fields between two instances is that the values need to be looked up in the same way as Elements Connect does. As the add-on doesn't provide a JIRA level API to actually do this lookup, a workaround needs to be used.
Elements Connect provides a REST Api allowing to extract the values as showed in the issue. Below is a snippet allowing to use this REST api to extract the required information
Storing Elements Connect values
To be able to store Elements Connect values, one needs to understand how the custom field is configured.
In the example below, Elements Connect depends on a table
audience_d2 which is stored in the JIRA database.
The code will:
- Open a connection to the database.
- Retrieve the right id from the table based on values provided by the remote instance.
- Set the local custom fields to the found id.
How to connect to a mysql database
Here is an example to connect to a mysql database