20200709094556_issue_3110_service_now_provider.rb 428 B

12345678910111213
  1. class Issue3110ServiceNowProvider < ActiveRecord::Migration[5.2]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. ExternalSync.where(source: 'ServiceNow').find_each do |row|
  6. article = Ticket.find(row.o_id).articles.first
  7. source_name = Channel::Filter::ServiceNowCheck.source_name(from: article.from)
  8. row.update(source: source_name)
  9. end
  10. end
  11. end