diff --git a/scripts/populate_review_step.py b/scripts/populate_review_step.py
index 9cccfd0..3c0e723 100644
--- a/scripts/populate_review_step.py
+++ b/scripts/populate_review_step.py
@@ -206,7 +206,7 @@ class PullSampleInfo(PullInfo):
         ('SR % Mapped', 'aggregated.pc_mapped_reads'),
         ('SR % Duplicates', 'aggregated.pc_duplicate_reads'),
         ('SR Mean Coverage', 'aggregated.mean_coverage'),
-        ('SR Species Found', 'matching_species'),
+        ('SR Species Found', 'aggregated.matching_species'),
         ('SR Sex Check Match', 'aggregated.gender_match'),
         ('SR Genotyping Match', 'aggregated.genotype_match'),
         ('SR Freemix', 'sample_contamination.freemix'),
@@ -237,12 +237,10 @@ class PullSampleInfo(PullInfo):
         return artifacts
 
     def field_from_entity(self, entity, api_field):
-        # TODO: remove once Rest API has a sensible field for species found
-        if api_field == 'matching_species':
-            species = entity[api_field]
-            return ', '.join(species)
-
-        return super().field_from_entity(entity, api_field)
+        field = super().field_from_entity(entity, api_field)
+        if api_field == 'aggregated.matching_species':
+            return ', '.join(field)
+        return field
 
 
 class PushInfo(StepPopulator):

Matching species field is missing aggregated
https://github.com/EdinburghGenomics/clarity_scripts/blob/5b85e1e462c701d9e01f9a786d82688cfab4d391/scripts/populate_review_step.py#L209

Need to add the `aggregated` in the field name
diff --git a/tests/test_populate_review_step.py b/tests/test_populate_review_step.py
index 6e6c8e0..d6b8ec2 100644
--- a/tests/test_populate_review_step.py
+++ b/tests/test_populate_review_step.py
@@ -150,13 +150,15 @@ class TestPullSampleInfo(TestPopulator):
         'sample_id': 'a_sample',
         'user_sample_id': 'a_user_sample_id',
         'clean_yield_in_gb': 5,
-        'aggregated': {'clean_pc_q30': 70,
-                       'pc_mapped_reads': 75,
-                       'pc_duplicate_reads': 5,
-                       'mean_coverage': 30,
-                       'gender_match': 'Match',
-                       'genotype_match': 'Match'},
-        'matching_species': ['Homo sapiens', 'Thingius thingy'],
+        'aggregated': {
+            'clean_pc_q30': 70,
+            'pc_mapped_reads': 75,
+            'pc_duplicate_reads': 5,
+            'mean_coverage': 30,
+            'gender_match': 'Match',
+            'genotype_match': 'Match',
+            'matching_species': ['Homo sapiens', 'Thingius thingy'],
+        },
         'sample_contamination': {'freemix': 0.1},
         'reviewed': 'pass',
         'review_comments': 'alright',
@@ -197,7 +199,7 @@ class TestPullSampleInfo(TestPopulator):
             assert poa.return_value[1].udf['SR Useable Comments'] == 'AR: Review failed'
 
     def test_field_from_entity(self):
-        obs = self.epp.field_from_entity(self.fake_rest_entity, 'matching_species')
+        obs = self.epp.field_from_entity(self.fake_rest_entity, 'aggregated.matching_species')
         assert obs == 'Homo sapiens, Thingius thingy'
 
 

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
asana==0.6.7
attrs==22.2.0
cached-property==1.5.2
certifi==2021.5.30
-e git+https://github.com/EdinburghGenomics/clarity_scripts.git@5b85e1e462c701d9e01f9a786d82688cfab4d391#egg=clarity_scripts
coverage==6.2
EGCG-Core==0.8.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==2.8
MarkupSafe==2.0.1
oauthlib==3.2.2
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyclarity-lims==0.4.8
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
PyYAML==6.0.1
requests==2.14.2
requests-oauthlib==0.8.0
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: clarity_scripts
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - asana==0.6.7
      - attrs==22.2.0
      - cached-property==1.5.2
      - coverage==6.2
      - egcg-core==0.8.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==2.8
      - markupsafe==2.0.1
      - oauthlib==3.2.2
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyclarity-lims==0.4.8
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pyyaml==6.0.1
      - requests==2.14.2
      - requests-oauthlib==0.8.0
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/clarity_scripts

tests/test_populate_review_step.py::TestPullSampleInfo::test_field_from_entity
tests/test_populate_review_step.py::TestEPP::test_init tests/test_populate_review_step.py::TestPopulator::test_init tests/test_populate_review_step.py::TestPullRunElementInfo::test_assess_sample tests/test_populate_review_step.py::TestPullRunElementInfo::test_field_from_entity tests/test_populate_review_step.py::TestPullRunElementInfo::test_init tests/test_populate_review_step.py::TestPullRunElementInfo::test_pull tests/test_populate_review_step.py::TestPullSampleInfo::test_assess_sample tests/test_populate_review_step.py::TestPullSampleInfo::test_init tests/test_populate_review_step.py::TestPushRunElementInfo::test_init tests/test_populate_review_step.py::TestPushRunElementInfo::test_push tests/test_populate_review_step.py::TestPushSampleInfo::test_init tests/test_populate_review_step.py::TestPushSampleInfo::test_push
scripts/populate_review_step.py
scripts/populate_review_step.py