def add_work_item_to(issue_id, attributes={})
      attributes = attributes.to_hash
      attributes.symbolize_keys!
      attributes[:date] ||= Date.current.iso8601
      epoc_date = Date.parse(attributes[:date]).to_time.to_i * 1000
      attributes[:user] ||= self.service.login
      work_items = REXML::Element.new('workItems')
      work_item = work_items.add_element('workItem')
      work_item.add_element('author').add_attribute('login', attributes[:user])
      work_item.add_element('date').add_text(epoc_date.to_s)
      work_item.add_element('duration').add_text(attributes[:duration].to_s)
      work_item.add_element('description').add_text(attributes[:description])
      put("import/issue/#{issue_id}/workitems", body: work_items.to_s, :headers => {'Content-type' => 'text/xml'} )
      response
    end
def add_work_item_to(issue_id, attributes={})
      attributes = attributes.to_hash
      attributes.symbolize_keys!
      attributes[:date] ||= Date.current.iso8601
      epoc_date = Date.parse(attributes[:date]).to_time.to_i * 1000
      attributes[:user] ||= self.service.login
      work_items = REXML::Element.new('workItems')
      work_item = work_items.add_element('workItem')
      work_item.add_element('author').add_attribute('login', attributes[:user])
      work_item.add_element('date').add_text(epoc_date.to_s)
      work_item.add_element('duration').add_text(attributes[:duration].to_s)
      work_item.add_element('description').add_text(attributes[:description])
      put("import/issue/#{issue_id}/workitems", body: work_items.to_s, :headers => {'Content-type' => 'text/xml'} )
      response
    end
Add new work item to issue

 issue_id   string  youtrack ticket id
 attributes    hash
      user         string  login name of the user who will be set as the author of the work item. (defaults to logged in user)
      date         string  date and time of the new work item in ISO8601 time format (defaults to current date)
      duration     string  Duration of the work item in minutes
      description  string  Activity description