How to create task using custom function.

How to create task using custom function.

Hi All,

I have to create task based on the drop down value. When a user select a value from drop down then a task is created and assigned to user. When we select another value from drop down then a new task is created and assigned to different user.
void calculate.Task(int potential_id)
{
    resp = zoho.crm.getRecordById("Potentials", input.potential_id);
    Potential_Name = resp.get("Potential Name");
    stage = resp.get("Stage");
    if (stage  ==  "Qualification")
    {
        result = zoho.crm.create("Tasks", { "Subject" : "A new email is arrived.", "SEMODULE" : "Contacts", "CONTACTID" : "xxxxxxxxxxxxxxxx" }, 2);
    }
    else if (stage  ==  "Needs Analysis")
    {
        result = zoho.crm.create("Tasks", { "Subject" : "A new email is arrived.", "SEMODULE" : "Contacts", "CONTACTID" : "xxxxxxxxxxxxxxxx" }, 2);
    }
}

task is assigned using hard core id. But i don't want to do like this. I want to assigned task to users in my crm.