Have a look at this custom rule, which should answer the "...after that changes the value of the current author information to a particular author" part of your question:
{ "rules_optionally_change_node_author" : {
"LABEL" : "Optionally hide change author",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_presave" : [] },
"IF" : [
{ "node_is_of_type" : {
"node" : [ "node" ],
"type" : { "value" : {
"article" : "article"
}
}
}
},
{ "entity_has_field" : { "entity" : [ "node" ], "field" : "field_optionlist" } },
{ "data_is" : { "data" : [ "node:field-optionlist" ], "value" : "C" } }
],
"DO" : [
{ "entity_fetch" : {
"USING" : { "type" : "user", "id" : "68" },
"PROVIDE" : { "entity_fetched" : { "user_fetched" : "Fetched user" } }
}
},
{ "data_set" : { "data" : [ "node:author" ], "value" : [ "user-fetched" ] } }
]
}
}
Some more details about this rule:
- The rule checks that the content type is "Article" (adapt to fit your needs, or just omit it if you want this logic to be applied for any content type).
- I added 2 extra Rules Conditions to verify that the field with machine name "
field_optionslist
" has a value of "C
" (adapt to fit your needs).
- In the Rules Action, it fetches the user with
uid=68
(replace 68
in it by the uid
that matches your particular author).
PS: I'm assuming this question is about D7.