Programmatically find out what fieldset a field belongs to, if any
If you call field_group_info_groups with the entity type and bundle, it will return all the field groups on the bundle, the fields should be in the children array under ['form'][YOUR_FIELDGROUP] e.g.

     $fieldgroups = field_group_info_groups('node', "YOUR_NODETYPE");
     $field_names = $fieldgroups['form']['YOUR_FIELDGROUP']-&gt;children;


$fieldnames should now contain a list of all the fields that pertain to YOUR_FIELDGROUP. Which you can now parse through using a foreach loop.

     $node = node_load(2);
     foreach ($field_names as $key =&gt; $field_name) {
      $field_items = field_get_items('node', $node, $field_name);
      // Do something cool here. 
     }