Search for Pull Requests containing a markdown link

The usecase: we put a title on top of the pasted link to our ticket system (it’s Wrike, imagine JIRA). So, developer of a project creates a Pull Requests, pastes a link to ticket system, then API notifies about new Pull Request, we parse it for links and replace it in a way that’s a markdown link where link’s title is a ticket title and the pasted link is the same URL.

I want to search for Pull Requests which contain a specified link or at least a number from the URL. It does not work when URL is hidden inside markdown link.

I use GraphQL API:


query {
  search(query:"org:our_organization 545405906 in:body is:pr", type: ISSUE, first: 3) {
    edges {
      node {
        ...on PullRequest {
          id
          title
          body
          
          repository {
            name
          }
        }
      }
    }
  }
}

where 545405906 is an ID of a ticket. I empty result.

To me it seems it’s a bug. I think that API searches inside rendered body instead of markdown source.

I can think of 2 workarounds:

  1. configure autolinks in all our repositories, then search by linked tickets in PRs instead of searching inside body. It’s not practical because we would have to remember about doing it for new repos.
  2. simply download lots of PRs bodies and search on our side every time our ticket system gets updated for one ticket. However, I don’t want to abuse GitHub servers for this nor the network bandwith.