On 3.7 the issue
MDL-63262 introduced changes on the return types of badges WS.
The WS were not propperly tested and return on alignments have targetname field but the exporter determines targetName with capital N so this field is never returned.
There are many more cases like that. This issue should check all changes on the
MDL-63262 and all the WS afected. Be careful with get_alignments functions that is defined in core_badges_assertion and badge class.