code: def add_automatic_comment(self, ref):
          
          if self.fixed is True:
              text = (DOWNTIME_FIXED_MESSAGE % (ref.my_type,
                                                time.strftime("%Y-%m-%d %H:%M:%S",
                                                              time.localtime(self.start_time)),
                                                time.strftime("%Y-%m-%d %H:%M:%S",
                                                              time.localtime(self.end_time)),
                                                ref.my_type))
          else:
              hours, remainder = divmod(self.duration, 3600)
              minutes, _ = divmod(remainder, 60)
              text = (DOWNTIME_FLEXIBLE_MESSAGE % (ref.my_type,
                                                   time.strftime("%Y-%m-%d %H:%M:%S",
                                                                 time.localtime(self.start_time)),
                                                   time.strftime("%Y-%m-%d %H:%M:%S",
                                                                 time.localtime(self.end_time)),
                                                   hours, minutes, ref.my_type))
  
          data = {
              'comment': text,
              'comment_type': 1 if ref.my_type == 'host' else 2,
              'entry_type': 2,
              'source': 0,
              'expires': False,
              'ref': ref.uuid
          }
          comment = Comment(data)
          self.comment_id = comment.uuid
          ref.comments[comment.uuid] = comment
          return comment
docs: Add comment on ref for downtime
  
          :param ref: the host/service we want to link a comment to
          :type ref: alignak.objects.schedulingitem.SchedulingItem
  
          :return: None