@@ -167,7 +167,8 @@ func importNetworks(networks []keyfactor_command_client_api.KeyfactorApiModelsSs
167167 }
168168}
169169
170- func findMatchingTempIds (exportedWorkflowDef exportKeyfactorApiModelsWorkflowsDefinitionCreateRequest , kfClient * keyfactor_command_client_api.APIClient ) * string {
170+ // identify matching templates between instances by name, then return the template Id of the matching template in the import instance
171+ func findMatchingTemplates (exportedWorkflowDef exportKeyfactorApiModelsWorkflowsDefinitionCreateRequest , kfClient * keyfactor_command_client_api.APIClient ) * string {
171172 importInstanceTemplates , _ , _ := kfClient .TemplateApi .TemplateGetTemplates (context .Background ()).XKeyfactorRequestedWith (xKeyfactorRequestedWith ).XKeyfactorApiVersion (xKeyfactorApiVersion ).Execute ()
172173 for _ , template := range importInstanceTemplates {
173174 importInstTempNameJson , _ := json .Marshal (template .TemplateName )
@@ -190,7 +191,7 @@ func importWorkflowDefinitions(workflowDefs []exportKeyfactorApiModelsWorkflowsD
190191 fmt .Printf ("Error: %s\n " , jErr )
191192 log .Fatalf ("Error: %s" , jErr )
192193 }
193- newTemplateId := findMatchingTempIds (workflowDef , kfClient )
194+ newTemplateId := findMatchingTemplates (workflowDef , kfClient )
194195 if newTemplateId != nil {
195196 workflowDefReq .Key = newTemplateId
196197 }
@@ -204,6 +205,7 @@ func importWorkflowDefinitions(workflowDefs []exportKeyfactorApiModelsWorkflowsD
204205 }
205206}
206207
208+ // check for built-in report discrepancies between instances, return the report id of reports that need to be updated in import instance
207209func checkBuiltInReportDiffs (exportedReport exportModelsReport , kfClient * keyfactor_command_client_api.APIClient ) * int32 {
208210 importInstanceReports , _ , _ := kfClient .ReportsApi .ReportsQueryReports (context .Background ()).XKeyfactorRequestedWith (xKeyfactorRequestedWith ).XKeyfactorApiVersion (xKeyfactorApiVersion ).Execute ()
209211 //check if built in report was modified from default in exported instance; if modified, update built-in report in new instance
0 commit comments