Skip to content

Commit 1dc4f30

Browse files
authored
Merge pull request Yelp#2978 from ferozsalam/fix-jira-alert-titles
Fix the use of timestamps in the Jira ticket titles
2 parents ea62cf4 + 734caf2 commit 1dc4f30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

elastalert/alerts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,9 @@ def create_default_title(self, matches, for_search=False):
868868
if for_search:
869869
return title
870870

871-
title += ' - %s' % (pretty_ts(matches[0][self.rule['timestamp_field']], self.rule.get('use_local_time')))
871+
timestamp = matches[0].get(self.rule['timestamp_field'])
872+
if timestamp:
873+
title += ' - %s' % (pretty_ts(timestamp, self.rule.get('use_local_time')))
872874

873875
# Add count for spikes
874876
count = matches[0].get('spike_count')

0 commit comments

Comments
 (0)