Add customer users via api through workflow transition

Hi,

I want to add JSD customers via workflow transition.
I have written the below script in custom script in the post function but i am having status -412

Please see script below:
import groovy.json.JsonSlurper;
import groovy.json.StreamingJsonBuilder;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue
import org.apache.commons.codec.binary.Base64;
import groovyx.net.http.HTTPBuilder
import static groovyx.net.http.ContentType.*
import groovyx.net.http.ContentType
import static groovyx.net.http.Method.*
import groovy.json.JsonSlurper
import net.sf.json.groovy.JsonSlurper
import groovy.json.JsonOutput
import com.atlassian.jira.component.ComponentAccessor
import groovy.json.JsonBuilder

//def finalJSON = new JsonBuilder(jsonBody).toString().build()

def jsonBody = [:]

jsonBody.put(“email”, "fred10@example.com")
jsonBody.put(“fullName”, “Fred F. User10”)
jsonBody.put(“X-ExperimentalApi”,“opt-in”)

// Define Web API to post to
def baseURL = “http://jiradev.mcb.local:8080/rest/servicedeskapi/customer;

// Establish Connection and post data

URL url = new URL(baseURL);
//URLConnection connection = url.openConnection();

HttpURLConnection connection = url.openConnection() as HttpURLConnection;
connection.requestMethod = “POST”
connection.doOutput = true
connection.setRequestProperty(‘Authorization’, 'Basic ’ + ‘mcbadmin:s@msung’.bytes.encodeBase64().toString())
//connection.setRequestProperty({ key: ‘X-ExperimentalApi’ , value: ‘opt-in’ });
connection.setRequestProperty(“Content-Type”, “application/json;charset=UTF-8”)
connection.outputStream
connection.outputStream.withWriter(“UTF-8”) { new StreamingJsonBuilder(it, jsonBody) }
connection.connect();
log.info (“URL=”+url+“Status=”+connection.getResponseCode() as String)

Kindly advice.

Thanks,
Swarna