Requirement:
All the tickets that are assigned to specific sites has to be moved to a corresponding instances that are built for the sites.
For example: Site A ticket from IT instance should be moved to Instance A.
The tickets once moved should be closed in the IT instance. The tickets that are moved should have all the fields to be migrated along with the additional fields in the new instance.
Also, the url for the same ticket in the IT instance should be added as a note in the freshly created ticket so that one can check the history details if required.
Script Requirements:
1. UDF Fields have to be mapped from the source portal to the target portal
2. Target portal should have similar template names, status, priority, urgency and other basic request properties names as the Source portal.
3. Source portal request link will be added as a note to the Target portal.
Steps to Configure:
1. Update the target Portal ID, the UDF field mappings, URL and TechnicianKey in the script.
2. Execute the below query in the source portal and export the ticket list as a csv file.
Note: Update the site name as per your instance
Query:
SELECT wo.helpdeskid "portalid",
wo.workorderid AS "workorderid",
sdo.NAME AS "site"
FROM workorder wo
LEFT JOIN sitedefinition siteDef ON wo.siteid = siteDef.siteid
LEFT JOIN sdorganization sdo ON siteDef.siteid = sdo.org_id
WHERE wo.isparent = '1' and sdo.NAME='<Site_Name>'
3. Update the exported file name in the script. In my instance, its 1649406192529.csv
4. Also, update the URL, TechnicianKey and the UDF_Mappings in the script file. Refer the below screenshot.
6. Since this is a one time activity, we can execute the same from the command prompt itself.
Make sure both the csv file and the python files are in the same folder. Open command prompt in the file location folder, and use the below command to invoke the script: py dataMigration_addRequests.py
Note:
- The script would write all the success and failure Ticket ids to a file.
- Failed List will be saved in a csv file with file name: <target_portal_id>_failed_records.csv
- Success List will be saved in a csv file with file name: <target_portal_id>_success_records.csv
- We will be updating the created time of the target request with that of the source request after the ticket creation at the target portal.