How to get lead asign by and asign to

How to get a lead assigned by and assigned to."

When assigned the lead then it will create a ToDo. You can find it in ToDo DocType.

get by code

Yes, we have come to know that you need code, but there should be some logic and some scenario to write in that code.

What is the use case? please elaborate on the scenario.

doctype lead assigned by and assigned to get, and after 3 days of lead creation without modifying, an email is sent to the assignee. After 7 days without modifying the lead, an email is sent to the assignor.