<commit_before>Config = require "../config"
Utils = require "../utils"

class Ticket
  constructor: (json) ->
    @[k] = v for k,v of json

  toAttachment: (includeFields=yes) ->
    colors = [
      keywords: "story feature improvement epic"
      color: "#14892c"
    ,
      keywords: "bug"
      color: "#d04437"
    ,
      keywords: "experiment exploratory task"
      color: "#f6c342"
    ]
    result = Utils.fuzzyFind @fields.issuetype.name, colors, ['keywords']

    fields = []
    fieldsFallback = ""
    if includeFields
      if @watchers?.length > 0
        watchers = []
        fallbackWatchers = []<commit_msg>Add a default color to tickets if we don't fuzzy find one<commit_after>Config = require "../config"
Utils = require "../utils"

class Ticket
  constructor: (json) ->
    @[k] = v for k,v of json

  toAttachment: (includeFields=yes) ->
    colors = [
      keywords: "story feature improvement epic"
      color: "#14892c"
    ,
      keywords: "bug"
      color: "#d04437"
    ,
      keywords: "experiment exploratory task"
      color: "#f6c342"
    ]
    result = Utils.fuzzyFind @fields.issuetype.name, colors, ['keywords']
    result = color: "#003366" unless result

    fields = []
    fieldsFallback = ""
    if includeFields
      if @watchers?.length > 0
        watchers = []
        fallbackWatchers = []
{'fraction_non_alphanumeric': 0.12946428571428573, 'fraction_numerical': 0.026785714285714284, 'mean_word_length': 2.4844559585492227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4190264', 'n_tokens_mistral': 452, 'n_tokens_neox': 414, 'n_words': 116}