def check_jira_all_projects_are_visible()

in jbi/jira/service.py [0:0]


    def check_jira_all_projects_are_visible(self, actions):
        # Do not bother executing the rest of checks if connection fails.
        if messages := self.check_jira_connection():
            return messages

        try:
            visible_projects = self.fetch_visible_projects()
        except requests.HTTPError:
            return [
                checks.Error(
                    "Error fetching visible Jira projects", id="jira.visible.error"
                )
            ]

        missing_projects = actions.configured_jira_projects_keys - set(visible_projects)
        if missing_projects:
            return [
                checks.Warning(
                    f"Jira projects {missing_projects} are not visible with configured credentials",
                    id="jira.projects.missing",
                )
            ]

        return []