How to Create a Jira Workflow Condition that only allows the transition if there has been a pull request

In Jira Cloud, How can I Create a Jira Workflow Condition using a ScriptRunner Script as the condition in a workflow transition that only allows the transition if there has been a pull request?