Skip to content
Advertisement

ampersand is being replaced with comma

I am trying to do a rest call to jira and the jql is as below.

jql="Project" = "Test: Dev int: commons & Uig mat"

so when i do the rest call to jira, it is replacing the jql as below:

jql="Project" = "Test: Dev int: commons ',' Uig mat"

so, the & is being replaced with “,” which is throwing an error as that project is not available in jira

I tried replacing the “,” with &, it is again replacing it with “,” while it is run.

import requests

url = "https://jira.com/login/rest/api/2/search"
querystring = {jql='working Project' = 'Test: Dev int: commons & Uig mat'}


headers = {
    'content-type': "application/json",
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

I want to pass in exact string to jira to process and do the query

Advertisement

Answer

I just replaced & with %26 and it worked just fine

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement