Skip to content

Commit

Permalink
[handler] Minor fixes in Jira handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-afedorov committed Sep 12, 2020
1 parent 3f6821e commit 2d345aa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/runners/handlers/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

PROJECT = environ.get('SA_JIRA_PROJECT', environ.get('JIRA_PROJECT', ''))
URL = environ.get('SA_JIRA_URL', environ.get('JIRA_URL', ''))
TRIAGE_LINK = environ.get('SA_JIRA_TRIAGE_URL', environ.get('JIRA_TRIAGE_URL', '{}'))
ISSUE_TYPE = environ.get('SA_JIRA_ISSUE_TYPE', environ.get('JIRA_ISSUE_TYPE', 'Story'))
TODO_STATUS = environ.get(
'SA_JIRA_STARTING_STATUS', environ.get('JIRA_STARTING_STATUS', 'To Do')
Expand Down Expand Up @@ -55,7 +56,10 @@


def jira_ticket_body(alert, project):
alert['SOURCES'] = ', '.join(alert['SOURCES'])
query_name = alert['QUERY_NAME']
sources = alert['SOURCES']
alert['QUERY_NAME'] = f'[{query_name}|{SA_JIRA_TRIAGE_URL.format(query_name)}]'
alert['SOURCES'] = ', '.join(sources) if isinstance(sources, list) else sources
escaped_locals_strings = {k: escape_jira_strings(v) for k, v in alert.items()}
sources = escaped_locals_strings['SOURCES']
escaped_locals_strings[
Expand Down Expand Up @@ -107,7 +111,11 @@ def link_search_todos(description=None, project=PROJECT):


def create_jira_ticket(
alert, assignee=None, custom_fields=None, project=PROJECT, issue_type=ISSUE_TYPE,
alert,
assignee=None,
custom_fields=None,
project=PROJECT,
issue_type=ISSUE_TYPE,
):
if not user:
return
Expand Down

0 comments on commit 2d345aa

Please sign in to comment.