roleImporter V11 assignUserstoRole for complex criteria upload is not working

Thanks everyone.

The quotes in my CSV are U+0022, they got changed to U+201C when copy pasting the code into here.

I had another look at the roleImporter documentation and found two key differences-

  • children of children (members of a criteria group, where they are several) are formatted differently in the API response vs roleImporter format (lines 100 to 123)
  • roleImporter takes sourceId instead of sourceName (line 131)

I edited my csv manually to align with what’s in the roleImporter documentation. This worked.

But what are meant to do if we have 100+ criteria to upload? Manually reformatting every single one of them is obviously not feasible… Nor is writing them from scratch if you’re not restoring using the API response but instead uploading them for the first time.
Does anyone know of a way to convert API response format to roleImporter format?
How is everyone prepping their roleImporter input file when using assignUserstoRole?

Corrected csv: