Sha256: f8193cd56b66628819d69ca9c13970863ea32444bcb0476826e8b3a54d85c93a

Contents?: true

Size: 765 Bytes

Versions: 3

Compression:

Stored size: 765 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.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

3 entries across 3 versions & 1 rubygems

Version Path
you_track-0.2.2 lib/you_track/parser/issues_parser.rb
you_track-0.2.1 lib/you_track/parser/issues_parser.rb
you_track-0.2.0 lib/you_track/parser/issues_parser.rb