In the admin section, for any given node, I need to add a dropdown field that lets QA assign that node to a developer who had previously made changes to the node's workflow state. I am currently using the workflow module (https://www.drupal.org/project/workflow). This field needs to be populated with users who have changed the node's workflow state before. So, I'm working on a module that can do this. My question is, how do you programmatically get the workflow state transition history for a given element?
For every revision of a given node that has involved a workflow change, I would need the following information:
- The state or state id (sid) that it was changed to.
- The uid of the user that made the change.
- The order in which the workflow state transitions were made.
I tried node_revision_list, but it does not include revisions that only change the workflow state. (Because it's not looking at the workflow_node_history table).
I can get the information I need directly from the database by running the following query, but I don't want to do any database-hacking if this functionality is already in Drupal somewhere.
SELECT sid, uid FROM `workflow_node_history` WHERE `nid` = ? ORDER BY stamp asc
Is there a Drupal function that already does this?