This process assumes that Issues being referenced in Salesforce have been imported with different Issue IDs but same Issue Keys during the JIRA migration. In other words, it assumes that Issue IDs DO NOT match between Jira instances.
Migration of Salesforce Case-Issue links maintained by zAgileConnect to another JIRA Server or Data Center (from another Jira Server or Data Center instance) involves the following steps:
Backup zAgileConnect junction objects (optional)
Create a CSV file with Case-Issue relationships
Remove zAgileConnect junction objects data
Connect and configure the Salesforce org to the new Jira Server/Data Center instance
Import the Case-Issue relationships from the CSV file into Salesforce and Jira and synchronize Case-Issue Data in Jira
These steps are described below:
1. Backup zAgileConnect junction objects
In Salesforce setup go to Data Export and export the data for ZIssue__c, ZIssue_SF__c and ZIssue_Case__c
2. Create a CSV file with Case-Issue relationships
Generate a CSV file with only 3 column headers CASENUMBER, ISSUEKEY, ISSUEWASCREATED.
You can use the following SOQL query to retrieve the case-issue relationship data:
SELECT zsfjira__Case__r.CaseNumber, zsfjira__ZIssue__r.zsfjira__IssueKey__c, zsfjira__IssueCreated__c FROM zsfjira__ZIssue_SF__c WHERE zsfjira__Case__c != null
Workbench can be used to export the data to CSV file via SOQL query.
Make sure to rename the CSV headers to CASENUMBER, ISSUEKEY, ISSUEWASCREATED.
3. Remove zAgileConnect junction objects data
Delete all the records for ZIssue__c Salesforce object. This delete will also delete in cascade the data for the junction objects (ZIssue_SF and ZIssue_Case).
Execute the following APEX code via an anonymous block using developer console or workbench to remove existing Salesforce-Jira relationships.
delete[SELECT Id FROM zsfjira__ZIssue__c];
The DML operation above may fail if there are too many (>10,000) records to be deleted. In such scenario, you can change the SOQL to append a “LIMIT” clause to it to reduce the number of records returned by the query and execute it multiple times.
4. Connect and configure zAgileConnect with Jira Server/Data Center
The same Salesforce instance that was previously connected to the original (source) Jira instance can be re-connected to new Jira Server/Data Center (destination) following the Jira Server/Data Center installation instructions
Please note that after authentication steps are completed, the remaining zAgileConnect package configuration (Steps 3 thru 6) that is inherited from original Jira should either be ‘Saved’ as-is or modified and Saved to allow these configurations to also be pushed to the new (destination) Jira Server/Data Center instance.
5. Import the Case-Issue relationships from the CSV file into Salesforce and Jira and synchronize Case-Issue Data in Jira
Before importing make sure any custom trigger, process or flow on ZIssue__c, ZIssue_SF__c and ZIssue_Case__c objects are disabled to avoid any unexpected error when importing the CSV.
Follow this guide to import the relationships CSV file Importing Existing Case-Issue Relationships into zAgileConnect
Please note that the example in the link above has only two columns but you will be importing the CSV file with 3 columns (CASENUMBER, ISSUEKEY, ISSUEWASCREATED).