def get_valid_cases_via_priorities(self, plan_id, priorities):
        cases = []
        if len(priorities) == 0:
            try:
                the_cases = self.server.TestCase.filter({
                    'plan__plan_id': plan_id,
                    'is_automated': 1,
                    'case_status__name': 'CONFIRMED'})
            except:
                raise TCMSException("ERROR[TCMS]': \
                        Failed to filter case")
            else:
                cases = [case['case_id'] for case in the_cases]
        else:
            for priority in priorities:
                try:
                    the_cases = self.server.TestCase.filter({
                        'plan__plan_id': plan_id,
                        'is_automated': 1,
                        'case_status__name': 'CONFIRMED',
                        'priority__value': priority.upper()})
                except:
                    raise TCMSException("ERROR[TCMS]': \
                            Failed to filter case")
                else:
                    cases1 = [case['case_id'] for case in the_cases]
                    cases = list(set(cases1 + cases))
        return cases
for getting case ids via plan id and priorities
dataset/ETHPy150Open idumpling/robotx/robotx/core/nitrateclient.py/TCMS.get_valid_cases_via_priorities