Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def generate_folder(tickets_json, project_id: str, jira_key: str, extension) -> str:
summary = jira.get_issue_json(tickets_json, jira_key)['fields']['summary']
sections = list(map(lambda s: s.strip().title(), summary.split(':')))
sections = sections[:-1] # remove last bit of summary
sections = list(filter(lambda s: len(s) < 50, sections))
if extension is not None:
sections = extension(jira.get_issue_json(tickets_json, jira_key), sections)
sections.insert(0, project_id)
return '/'.join(sections) + '/'
def generate_folder(tickets_json, project_id: str, jira_key: str, extension) -> str:
summary = jira.get_issue_json(tickets_json, jira_key)['fields']['summary']
sections = list(map(lambda s: s.strip().title(), summary.split(':')))
sections = sections[:-1] # remove last bit of summary
sections = list(filter(lambda s: len(s) < 50, sections))
if extension is not None:
sections = extension(jira.get_issue_json(tickets_json, jira_key), sections)
sections.insert(0, project_id)
return '/'.join(sections) + '/'
def generate_extension(tickets_json, jira_key: str) -> str:
issuetype = jira.get_issue_json(tickets_json, jira_key)['fields'] \
.get('issuetype', {}) \
.get('name', "")
if len(issuetype.strip()) == 0:
return ""
return "." + issuetype.replace(" ", "")