首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JQL查询中出错:字符\'%\‘是保留的JQL字符

JQL查询中出错:字符\'%\‘是保留的JQL字符
EN

Stack Overflow用户
提问于 2016-09-30 18:56:36
回答 1查看 3K关注 0票数 1

在jira中,我有一个名为"Abc Def Management“的项目。当我尝试使用rest Api获取这个项目中的所有问题时,我得到了以下错误。

代码语言:javascript
复制
errorMessages: [ 'Error in the JQL Query: The character \'%\' is a reserved JQL character. You must enclose it in a string or use the escape \'\\u0025\' instead.

我在下面输入我的代码。

代码语言:javascript
复制
client.post("https://xxx.atlassian.net/rest/auth/1/session", loginArgs, function(data, response){
        console.log('Response', response);
        if (response.statusCode == 200) {
            console.log('succesfully logged in, session:', data.session);
            var session = data.session;
            // Get the session information and store it in a cookie in the header
            var searchArgs = {
                headers: {
                    // Set the cookie from the session information
                    cookie: session.name + '=' + session.value,
                    "Content-Type": "application/json"
                },
                data: {
                    // Provide additional data for the JIRA search. You can modify the JQL to search for whatever you want.
                    jql: "project=Abc%20Def%20Management"
                }
            };
            // Make the request return the search results, passing the header information including the cookie.
            client.post("https://xxx.atlassian.net/rest/api/2/search", searchArgs, function(searchResult, response) {
                console.log('status code:', response.statusCode);
                console.log('search result:', searchResult);
            });
            // response.render('index', {
            // });
        }
        else {
            console.log("Login failed");
            // throw "Login failed :(";
        }
    });

如何解决此错误?

EN

回答 1

Stack Overflow用户

发布于 2016-10-03 07:52:13

使用空格而不是%20。

您正在使用POST请求,该请求将在其主体中包含jql,而不是作为url的一部分。因此不需要对任何内容进行url编码。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39789902

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档