Customizing contact_by in Opportunity form

I am trying to set the contact_by to different User based on the kind of Opportunity, I am even passing the right email, as its a link field with options as User while calling the API, but it always defaults to the contact_by of the Lead for which this Opportunity is being created.

Any pointers regarding what I am missing would really help.
Thanks

Have you looked at the opportunity.js file? It may be the place where you need to modify or override contact_by

We are using ERPNext as a service and modifying it or overriding will not be be possible I guess

Can you please share what you have done till now?

I have fields like phone, contact_by locality, city and pincode in lead form which captures the data from our site for a lead.
If the same user comes and puts up some other details this should create an opportunity with these new data, but its using the data from the original lead and populating the Opportunity.

You can create custom script even in cases when you are hosting on cloud.