I have answered this question already on another question. Here is the full answer i provided there:
For the benefit of those who encounter this same problem without a solution, this module: Entity Reference Prepopulate Token will provide a perfect solution. Please make sure you are using the latest dev version of Entity Reference Prepopulate module (as at 2015-Jun-10 or higher).
After enabling the module, go to the content type edit page and scroll down to where you have "Provider" and enter the following comma separated values in the text box provided under "Tokens and panel pane context":
Just enter the above values in the box and select the optional checkbox for this provider option to activate it, hide the field from the user also if desired, to avoid editing. I've tested it, It works!
According to the module page:
This module supplements Entityreference prepopulate module (dev
version is required) by adding prepopulate provider which sets default
field values using tokens and replacement patterns of panel pane
Two kind of patterns can be used for prepopulating entity reference
Tokens, e.g [current-page:url:unaliased:args:value:1] (it returns
value "100" for address "node/100", Token module is required).
Replacement patterns of panel pane contexts, e.g. %node:nid (it
returns node identifier if the form containing entity reference field
is placed on node view page created by Page manager). Panels module is
required for using these patterns.