Sha256: 15f9826626508c7d7f20dfcf46d66b477ecf0e8b1e394bd43c3c4ab3a10d17c1

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 Bytes

Contents

module JiraIssues
  class JiraIssueMapper
    # WIP
    # ATM mapper serialises issue to JSON
    # We might consider using objects

    def call(issue)
      filter_status = decode_status(issue)
      JiraIssues::JiraIssue.new do |i|
        i.key           = issue.key
        i.type          = issue.issuetype.name
        i.priority      = issue.priority.name
        i.status        = issue.status.name
        i.filter_status = filter_status
        i.description   = issue.description
        i.summary       = issue.summary
        i.assignee      = issue.assignee
        i.reporter      = issue.reporter
        i.created_date  = issue.created
        i.closed_date   = issue.resolutiondate
        i.due_date      = issue.due_date
      end
    end

    private

    def decode_status(issue)
      JiraIssues::JiraWorkflow.issue_status_for_name(project_key(issue),issue.status.name)
    end

    def project_key(issue)
      issue.key.split('-').first
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jira_issues-0.0.6 lib/jira_issues/jira_issue_mapper.rb