Skip to content

Instantly share code, notes, and snippets.

@erincandescent
Created January 13, 2013 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erincandescent/4522321 to your computer and use it in GitHub Desktop.
Save erincandescent/4522321 to your computer and use it in GitHub Desktop.
Notifico JIRA hook change proposal: don't display field updates when the value > 40 characters to prevent message truncation or channel flooding
Add:
def change_summary(field, value):
if len(value) < 40:
return '{0} set to "{1}"'.format(field, value)
else:
return '{0} updated'.format(field)
At notifico/services/hooks/jira.py line 178, change to:
if simplified['changes']:
changes = simplified['changes']
line.append(' -'.join([change_summary(k, v) for k, v in changes.items()]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment