I get an error when I execute my script to create a user with a custom role. Level 2 is assigned as well to the user but no luck executing the code successfully.
java.lang.Exception:The server at 'https://XXXXXXXXXXXXX.XXXXXXX.com:7443/arcgis/sharing/rest/community/createUser' returned an error. The user account cannot be created as the role assigned to it does not exist. (Error Code: 500)
But the custom role exists when I see logging in as an admin through the UI.
Can I get some help? Thanks.