The image attached shows what we see in the GUI if we go to the PR manually.
My script searches for PRs (that have the string: DEVELOPERS-XXXX). Once I have the paginated list, it uses them one by one:
from github import Github
github_t = os.environ.get('GITHUB_TOKEN')
github_c = Github(github_t)
git_i = github_c.search_issues('DEVELOPERS-XXXX', state='open')
for search in git_i:
result = subprocess.run(['gh', 'pr', 'view', fun_search_pr.html_url, '--json', 'mergeStateStatus'], capture_output=True, text=True)
{
"mergeStateStatus": "BEHIND"
}