Sha256: e4037c1282b19506f474395073a53500ed677993eae9b2484157d5a20b6eeefa

Contents?: true

Size: 812 Bytes

Versions: 9

Compression:

Stored size: 812 Bytes

Contents

class YouTrack::Parser::IssuesParser < YouTrack::Parser::IssueParser
  def parse
    return [] if raw["issues"].nil?      # i hate xml
    results = raw["issues"]["issue"].dup # i really hate xml
    results = [results] if results.is_a?(Hash)

    results.each do |result|
      fields = result.delete("field")
      standard_fields = fields.select { |k| k["xsi:type"] == "SingleField" }
      fields = fields - standard_fields
      attachments = fields.select { |k| k["xsi:type"] == "AttachmentField" }
      custom_fields = fields - attachments

      result.merge!(parse_fields(standard_fields))
      result["custom_fields"] = parse_fields(custom_fields)
      result["attachments"]   = parse_attachments(attachments)
      result["comments"]      = results.delete("comment")
    end

    results
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
you_track-0.4.8 lib/you_track/parser/issues_parser.rb
you_track-0.4.7 lib/you_track/parser/issues_parser.rb
you_track-0.4.6 lib/you_track/parser/issues_parser.rb
you_track-0.4.5 lib/you_track/parser/issues_parser.rb
you_track-0.4.4 lib/you_track/parser/issues_parser.rb
you_track-0.4.2 lib/you_track/parser/issues_parser.rb
you_track-0.4.1 lib/you_track/parser/issues_parser.rb
you_track-0.4.0 lib/you_track/parser/issues_parser.rb
you_track-0.3.0 lib/you_track/parser/issues_parser.rb