Not able to assign value to hidden form field using form_alter hook
I managed to do it by validate handler of the form. Using validate handler I assigned my value to the form variable before submit.

In form alter hook call validate handler like below

$form['#validate'][] = 'my_module_name_form_validate';


And following is the validate handler function code

function my_module_name_form_validate(&amp;$form, &amp;$form_state) {    
$form['field_my_field']['#parents'] = array('field_my_field');
form_set_value($form['field_my_field'],array('und' =&gt; array(0 =&gt; array('value' =&gt; $new_value))),$form_state);


}

For reference please go through link