Sha256: 29ffe0e4b72b31a5262d59f36e64711d1924f8184cea2b267b70fe2298871ef7

Contents?: true

Size: 721 Bytes

Versions: 4

Compression:

Stored size: 721 Bytes

Contents

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

    def call(issue)
      status = decode_status(issue)
      {
          key: issue.key,
          type: issue.issuetype.name,
          priority: issue.priority.name,
          status: status,
          #description: i.description,
          summary: issue.summary,
          created_date: issue.created,
          closed_date: issue.resolutiondate
      }
    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

4 entries across 4 versions & 2 rubygems

Version Path
jira_issues-0.0.5 lib/jira_issues/jira_issue_mapper.rb
jira-issues-0.0.4 lib/jira_issues/jira_issue_mapper.rb
jira-issues-0.0.2 lib/jira_issues/jira_issue_mapper.rb
jira-issues-0.0.1 lib/jira_issues/jira_issue_mapper.rb