Problem evaluating script Invalid input (


I am trying the below code. But the line of code starting with openidm.patch() is giving error like below

problem evaluating script: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 5: Unexpected input: '(' @ line 5, column 16. openidm.patch("managed/user/" + userQry.result[0]._id, null, [{"operation":"replace", "field":"/givenName", "value":givenName}]) ^ 1 error

If I remove the above line, there is no compilation error.

Below is the code for the reference. Please refer the openidm.patch line and let me know if there is any issue with it.

    <scriptTask name="Create User" id="createManagedUser" scriptFormat="groovy" flowable:autoStoreVariables="false">
		def userQry = openidm.query("managed/user", ["_queryFilter": '/userName eq "'+userName+'"'])
		console.log("User query result is " + userQry)
		console.log("givenName is " +givenName)
		openidm.patch("managed/user" + userQry.result[0]._id,null,[{"operation":"replace","field":"/givenName","value":givenName}])
            def manager = (userQry.result.size() == 1) ? ("managed/user/" + userQry.result[0]._id) : null
            user = [
            readNewUserFromRepoParams = [_queryId:'for-userName',uid:userName]
            execution.setVariable("readNewUserFromRepoParams", readNewUserFromRepoParams)

There is a related stackoverflow post: