Send notification to Jira in custom description
This change makes possible to send notification to Jira in custom description (e.g. AlarmID) Change-Id: Ib7f9a438a27f29b17967c31922391d76f8f0092f
This commit is contained in:
parent
0b82639af0
commit
68a6a8319b
|
@ -134,6 +134,7 @@ class JiraNotifier(AbstractNotifier):
|
|||
notification.state,
|
||||
notification.alarm_id)
|
||||
jira_fields["comments"] = "{code}%s{code}" % (json.dumps(body, indent=3))
|
||||
jira_fields["description"] = 'Monasca alarm'
|
||||
|
||||
return jira_fields
|
||||
|
||||
|
@ -183,7 +184,7 @@ class JiraNotifier(AbstractNotifier):
|
|||
|
||||
issue_dict = {'project': {'key': jira_fields["project"]},
|
||||
'summary': jira_fields["summary"],
|
||||
'description': 'Monasca alarm',
|
||||
'description': jira_fields["description"],
|
||||
'issuetype': {'name': 'Bug'}, }
|
||||
|
||||
# If the JIRA workflow is created with mandatory components
|
||||
|
|
|
@ -50,6 +50,7 @@ def issue(component=True, custom_config=False):
|
|||
issue['fields'].update({'components': [{'name': 'MyComponent'}]})
|
||||
if custom_config:
|
||||
alarm_value = alarm()
|
||||
issue['fields'].update({'description': alarm_value.get('alarmName')})
|
||||
summary_format_string = 'Alarm created for {0} with severity {1} for {2}'
|
||||
summary = summary_format_string.format(alarm_value.get('alarmName'),
|
||||
alarm_value.get('newState'),
|
||||
|
|
Loading…
Reference in New Issue