You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/09/09 14:06:37 UTC
[kibble-scanners] 02/02: handle closer key errors properly
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git
commit 52fbb8e79a2492011f46918a1a31827f7757db29
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Sep 9 16:06:20 2018 +0200
handle closer key errors properly
it's a dict...
---
src/plugins/scanners/jira.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/scanners/jira.py b/src/plugins/scanners/jira.py
index cb1ba75..82703bc 100644
--- a/src/plugins/scanners/jira.py
+++ b/src/plugins/scanners/jira.py
@@ -81,7 +81,7 @@ def wasclosed(js):
if 'items' in citem:
for item in citem['items']:
if item['field'] == 'status' and (item['toString'].lower().find('closed') != -1 or item['toString'].lower().find('resolved') != -1):
- return (True, citem.get('author', 'Unknown'))
+ return (True, citem.get('author', {}))
else:
if 'items' in js:
for item in js['items']:
@@ -162,7 +162,7 @@ def scanTicket(KibbleBit, key, u, source, creds, openTickets):
if closer:
#print("Parsing closer")
closerEmail = closer.get('emailAddress', 'unknown@kibble').replace(" dot ", ".", 10).replace(" at ", "@", 1)
- displayName = closer['displayName']
+ displayName = closer.get('displayName', 'Unkown')
if displayName and len(displayName) > 0:
# Add to people db
pid = hashlib.sha1( ("%s%s" % (source['organisation'], closerEmail)).encode('ascii', errors='replace')).hexdigest()