def assert_jira_issue_in_epic(self, finding, engagement, issue_in_epic=True):
     instance = jira_helper.get_jira_instance(engagement)
     jira = jira_helper.get_jira_connection(instance)
     epic_id = jira_helper.get_jira_issue_key(engagement)
     issue_id = jira_helper.get_jira_issue_key(finding)
     epic_link_field = 'customfield_' + str(get_custom_field(jira, 'Epic Link'))
     url = instance.url.strip('/') + '/rest/api/latest/issue/' + issue_id
     response = jira._session.get(url).json().get('fields', {})
     epic_link = response.get(epic_link_field, None)
     if epic_id is None and epic_link is None or issue_in_epic:
         self.assertTrue(epic_id == epic_link)
     else:
         self.assertTrue(epic_id != epic_link)
 def get_epic_issues(self, engagement):
     instance = jira_helper.get_jira_instance(engagement)
     jira = jira_helper.get_jira_connection(instance)
     epic_id = jira_helper.get_jira_issue_key(engagement)
     response = {}
     if epic_id:
         url = instance.url.strip('/') + '/rest/agile/1.0/epic/' + epic_id + '/issue'
         response = jira._session.get(url).json()
     return response.get('issues', [])