search :: Wreq.Options -> URI -> Text -> IO [Issue]
search options host jql = do
  debug $ printf "Fetching %s..." url
  resp <- Wreq.getWith options url >>= asJSON
  return $ resp ^. responseBody ^. issues
  where
    url = uriToString id completeUrl ""
    completeUrl = host
      { uriPath = "/rest/api/2/search"
      , uriQuery = printf "?jql=%s" (escape $ Text.unpack jql)
      }
search :: Wreq.Options -> URI -> Text -> IO [Issue]
search options host jql = do
  debug $ printf "Fetching %s..." url
  resp <- Wreq.getWith options url >>= asJSON
  return $ resp ^. responseBody ^. issues
  where
    url = uriToString id completeUrl ""
    completeUrl = host
      { uriPath = "/rest/api/2/search"
      , uriQuery = printf "?jql=%s" (escape $ Text.unpack jql)
      }
search options host jql = do
  debug $ printf "Fetching %s..." url
  resp <- Wreq.getWith options url >>= asJSON
  return $ resp ^. responseBody ^. issues
  where
    url = uriToString id completeUrl ""
    completeUrl = host
      { uriPath = "/rest/api/2/search"
      , uriQuery = printf "?jql=%s" (escape $ Text.unpack jql)
      }