summaryrefslogtreecommitdiff
path: root/help/app/designs/ticket/by_includes_post_by_and_is_open_and_updated_at.js
blob: 3bd2a743d1dbfb8d7b467abddf8874ef020db725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function(doc) {
  var arr = {}
  if (doc['type'] == 'Ticket' && doc.comments) {
    doc.comments.forEach(function(comment){
      if (comment.posted_by && !arr[comment.posted_by]) {
        //don't add duplicates
        arr[comment.posted_by] = true;
        emit([comment.posted_by, doc.is_open, doc.updated_at], 1);
      }
    });
  }
}