How to get the content moderation entity related to node entity in drupal 8.2.x?
i did it with entityQuery

function hook_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id){
 if ($form_id='node_article_edit_form')
  {      
    $article=$form_state-&gt;getFormObject()-&gt;getEntity();
    //get the associated content moderation entity
    $id = Drupal::entityQuery('content_moderation_state')
       -&gt;condition('content_entity_id', $article-&gt;id())
        -&gt;execute();

    $stateEntities = Drupal::entityManager()
        -&gt;getStorage('content_moderation_state')
        -&gt;loadMultiple($id);
    $stateEntity=array_values($stateEntities)[0];
    $moderation_state = $stateEntity-&gt;get('moderation_state')-&gt;getString();
   }
 }