You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: jira_import_state.rb
    path of file: ./repos/gitlabhq/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class JiraImportState < ApplicationRecord
  include AfterCommitQueue
  include ImportState::SidekiqJobTracker
  include UsageStatistics

  self.table_name = 'jira_imports'

  ERROR_MESSAGE_SIZE = 1000 # 1000 characters limit
  STATUSES = { initial: 0, scheduled: 1, started: 2, failed: 3, finished: 4 }.freeze

  belongs_to :project
  belongs_to :user
  belongs_to :label

  scope :by
    
  def store_issue_counts
    import_label_id = Gitlab::JiraImport.get_import_label_id(project.id)

    failed_to_import_count = Gitlab::JiraImport.issue_failures(project.id)
    successfully_imported_count = project.issues.with_label_ids(import_label_id).count
    total_issue_count = successfully_imported_count + failed_to_import_count

    update(
      {
        failed_to_import_count: failed_to_import_count,
        imported_issues_count: successfully_imported_count,
        total_issue_count: total_issue_count
      }
    )
  end