def METHOD_NAME(doc):
	"""Updates `_comments` (JSON) property in parent Document.
	Creates a column `_comments` if property does not exist.
	Only user created Communication or Comment of type Comment are saved.
	`_comments` format
	        {
	                "comment": [String],
	                "by": [user],
	                "name": [Comment Document name]
	        }"""
	# only comments get updates, not likes, assignments etc.
	if doc.doctype == "Comment" and doc.comment_type != "Comment":
		return
	def get_truncated(content):
		return (content[:97] + "...") if len(content) > 100 else content
	if doc.reference_doctype and doc.reference_name and doc.content:
		_comments = get_comments_from_parent(doc)
		updated = False
		for c in _comments:
			if c.get("name") == doc.name:
				c["comment"] = get_truncated(doc.content)
				updated = True
		if not updated:
			_comments.append(
				{
					"comment": get_truncated(doc.content),
					# "comment_email" for Comment and "sender" for Communication
					"by": getattr(doc, "comment_email", None) or getattr(doc, "sender", None) or doc.owner,
					"name": doc.name,
				}
			)
		update_comments_in_parent(doc.reference_doctype, doc.reference_name, _comments)