diff --git a/tenb2jira/jira/task.py b/tenb2jira/jira/task.py index f8c2c54..07b4b7d 100644 --- a/tenb2jira/jira/task.py +++ b/tenb2jira/jira/task.py @@ -43,6 +43,7 @@ def gen_priority(self, field_id: str) -> None: """ value = str(self.fields[field_id]).lower() self.priority = str(self.idef.severity_map[value]) + self.fields['priority'] = {'id': self.priority} def gen_state(self, field_id: str): """ diff --git a/tenb2jira/processor.py b/tenb2jira/processor.py index 4f1ed59..51224d7 100644 --- a/tenb2jira/processor.py +++ b/tenb2jira/processor.py @@ -119,7 +119,7 @@ def build_mapping_db_model(self, issues.append(model(**item).asdict()) if issues: stmt = insert(model).values(issues)\ - .on_conflict_do_nothing() + .prefix_with('OR IGNORE') s.execute(stmt) s.commit() @@ -431,6 +431,7 @@ def sync(self): self.config['tenable']['last_run'] = ts self.finished_time = datetime.now() + self.engine.dispose() # Delete the mapping database. with Path(self.config["mapping_database"].get("path")) as p: p.unlink() diff --git a/tenb2jira/version.py b/tenb2jira/version.py index 8e95544..e83c613 100644 --- a/tenb2jira/version.py +++ b/tenb2jira/version.py @@ -1 +1 @@ -version = '2.0.2' +version = '2.0.3' diff --git a/tests/jira/test_task.py b/tests/jira/test_task.py index 6c83054..df3f68f 100644 --- a/tests/jira/test_task.py +++ b/tests/jira/test_task.py @@ -229,6 +229,7 @@ def test_generate(jira_config, 'summary': '[Test Name]', 'project': {'key': 'VULN'}, 'issuetype': {'id': 1}, + 'priority': {'id': '1'}, } assert tobj.priority == '1' jql = ('project = "VULN" AND issuetype = "Task" '