I'm using the Rules module and the Registration code module and I've tried configuring a rule like so:

Rules Event: upon saving a new user account(event).
Rules Condition: if the registration code used is "123456"(condition).
Rules Action: add a role for a user.
The rules export is as shown below:
{ "rules_give_trial_version" : { "LABEL" : "Give trial version", "PLUGIN" : "reaction rule", "OWNER" : "rules", "REQUIRES" : [ "rules", "regcode" ], "ON" : { "regcode_used" : [] }, "IF" : [ { "data_is" : { "data" : [ "regcode" ], "value" : "123456" } } ], "DO" : [ { "user_add_role" : { "account" : [ "user" ], "roles" : { "value" : { "10" : "10" } } } } ] } }

However, the Rules Action is not working (nothing works).

Any idea how to get this to work?

Note: The Rules Action works with the event "User has used a registration code" without any Rules Condition (if I temporarily remove that Rules Condition). But I'm badly in need of the condition as we want to check if a user has used a specific code. If yes, that user should be assigned a role.