Executing multiple iterations for a single request and then moving to the next request under a folder in a collection

Usecase:

  1. Under collection A, multiple folders X,Y,Z are present
  2. Under folder X -> Execute POST request for multiple iterations of data
  3. Under folder X -> after completion of POST request for multiple iterations, execute GET request once
  4. Validate

Solutions tried:

Tried achieving it with Send Next request in Postman as suggested by Sivcan Singh in github
The following is the script tried.
In Folder X-> for POST request - Pre-request script:

currentIterationCount = pm.environment.get('currentIterationCount');
numberOfIterations = pm.environment.get('numberOfIterations');

//set numberOfIterations if not set
if (!numberOfIterations) {
   pm.environment.set("numberOfIterations", pm.info.iterationCount);
}

//set currentIteration -> 1 if not set
if(!currentIterationCount) {
   pm.environment.set("currentIterationCount",1);
}
else {
   pm.environment.set('currentIterationCount', currentIterationCount+1);
}

In Folder X -> for Get Request - Pre-request script:

 currentIterationCount = pm.environment.get('currentIterationCount');
 numberOfIterations = pm.environment.get('numberOfIterations');

if(currentIterationCount < numberOfIterations)
{
   postman.setNextRequest('registerHost');
}

Observations:

  1. The GET request gets executed even if the Pre-request script is present in the first iteration itself
  2. The next request when redirected to the POST call, executes the data for first iteration and not the new iteration data.

How should i achieve this case. Postman currently does not support controlling per folder iteration count in a collection.

Solution available at https://github.com/postmanlabs/postman-app-support/issues/4996