20200709094556_issue_3110_service_now_provider.rb 505 B

123456789101112131415
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3110ServiceNowProvider < ActiveRecord::Migration[5.2]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. ExternalSync.where(source: 'ServiceNow').find_each do |row|
  7. article = Ticket.find(row.o_id).articles.first
  8. source_name = Channel::Filter::ServiceNowCheck.source_name(from: article.from)
  9. row.update(source: source_name)
  10. end
  11. end
  12. end