print('WARNING. We found a GitLab issue with the document number in the title and with metadata tag in description. But the metadata tag has wrong document id in it.')
returntitle_only_hit,metadata_hit,last_version
title_only_hit=None
metadata_hit=None
last_version=0
forissueinissues:
ifdocument['document']inissue.title:
meta=get_issue_metadata(issue.description)
ifmetaisNone:
title_only_hit=issue
else:
ifint(meta['mdms_id'])==document['mdms_id']:
metadata_hit=issue
iflen(meta['version'])>0:
last_version=int(meta['version'])
else:
print('WARNING. We found a GitLab issue with the document number in the title and with metadata '
'tag in description. But the metadata tag has wrong document id in it.')
returntitle_only_hit,metadata_hit,last_version
defget_issue_metadata(description):
'''
Find and parse the metada from the description of the issue