Hello,
i'm trying to use Jira's REST api to get an issue key using its name (summary).
My get request looks like this so far:
var getUrl = {
url : "https://" + process.env.JIRA_USERNAME + ":" + process.env.JIRA_PASSWORD + "@" + process.env.JIRA_BASE_URL + '/rest/api/2/search?jql=Summary~"\"'
+ testCaseID + '\""',
method: "GET"
};
The testCaseID is the changing summary variable , and some of the summaries contain saved JQL words, therefore I receive the following error:
""Error in the JQL Query: 'Access' is a reserved JQL word. You must surround it in quotation marks to use it in a query."
I tried to add quotation marks and save the testCaseID as a new variable
var testCase = '"'+TestCaseID+'"'
and add it where the testCaseID was, but then I receive following error:
["Error in the JQL Query: Expecting either 'OR' or 'AND' but got <testname>"
How can I solve this issue?
Hi @Tal Erez
You haven't specified which version of Jira you're using (cloud or server), although I don't think it should make any difference. You also haven't specified which programming language you're using - looks a bit like Java?
When I pass this query to the API using C#, it returns successfully
string query = @"/rest/api/3/search?jql=project=DS and summary~""Access""";
In C#, using 2 sets of double quotes leaves the string in double quotes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.