Authentication Error 401 when using node-jira module

穿精又带淫゛_ 提交于 2020-01-17 00:40:31

问题


I am trying to read an issue using a https://github.com/steves/node-jira , however I am getting an an error

 401: Unable to connect to JIRA during findIssueStatus.

Here is the code that I am using the code bellow on localhost:8433

var jiraApi = require('jira').JiraApi;

var config = {
    "username": "name@email.com",
    "password": "password",
    "port": 443,
    "host": "company.atlassian.net"
}

var issueNumber = "ABC-1";

var jira = new jiraApi('https', config.host, config.port, config.username, config.password, '2');
jira.findIssue(issueNumber, function(error, issue) {
    console.log('Status: ' + issue.fields.status.name);
});

回答1:


I just found the source to the jira api library and found the error message. Apparently "unable to connect to jira" actually means "unable to find issue".

    # Unable to find issue
    @jira.request.mostRecentCall.args[1] null, statusCode:401, null
    expect(@cb).toHaveBeenCalledWith(
        '401: Unable to connect to JIRA during findIssueStatus.')


https://github.com/steves/node-jira/blob/master/spec/jira.spec.coffee

okay, never mind that. I was able to hit the jira api with curl and found I was getting a 403 access denied. It would seem that your login has to have the jira api access turned on so probably that's what's wrong. So it is able to connect, but you're getting kicked out because your login has no access.



来源:https://stackoverflow.com/questions/25279599/authentication-error-401-when-using-node-jira-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!