Rules to Flag a node referenced by Commerce Order Line Item I have a site selling edit access to specific nodes. The site uses Drupal 7, Commerce, Commerce License (selling a Role with edit permission), Rules and Flag.
On the Add to Cart I have a Line Item Entity Reference where the customer selects the Node they want access to. Upon payment a 12 month license is generated and the Role with edit permissions is added to the User. That all works fine.

Here's what I need:
When the payment is successful I need a Rule to trigger and set a Flag (premier_listing) on the Node that was selected during the Add to Cart process.
However I can't seem to access the Node Entity in Rules or access the Line Item Entity Reference that the User selected.
Anybody have an idea how this could be done?
Thanks
I believe you'll either need to access the node ID from the line item entity using a loop within the Rules UI or what I think a simpler way would be to create a custom Rule that accomplishes the same task.

Something like:
Event:  order is completed. I guess you could use order paid in full.
Conditions:  Here is where a custom condition would come into play.  You'd need to dig through the order line items to the user-selected node, and then pass that node_id to the Rules action as a parameter.  Note:  you could also do this entire check within the action and then programmatically set the flag to avoid passing the node_id as a parameter.
Actions:  Set a flag on a node.  (The node parameter).