Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server returning Invalid issue number, although the number is valid #18

Open
mirgee opened this issue Feb 10, 2016 · 2 comments
Open

Server returning Invalid issue number, although the number is valid #18

mirgee opened this issue Feb 10, 2016 · 2 comments

Comments

@mirgee
Copy link

mirgee commented Feb 10, 2016

Hi, I get the bot to correctly find the project name, and login to the Jira server, however, it returns Invalid issue number message, altough the issue number is correct. I believe everything in the config file is setup properly, so I think the culprit is in the API call, maybe there is a bug in the way the plugin formats the API call. I would like to ask - how does the plugin format the API call? E.g. the string "MOB-27579" is mentioned, the message "MOB-27579 - ​_Invalid issue number._" is returned. Shouldn't the number be just "27579"? Thank you!

Here is my config file, can you please take a look? Does it seem OK? Thank you!

var slackbot = require('./lib/bot');

var config = {

  showIssueDetails: true,
  issueDetailsToShow: {'fields.summary':1 , 'fields.assignee' : 1, 'fields.creator' : 0, 'fields.description': 0},
  showDetailsByDefault: true,
  bot_name: "jira",
  token: '<token>',
  jira_urls: {
    // DEFAULT NODE IS REQUIRED.
    "DEFAULT": {url: "https://jira.concur.com/jira/browse/"},
    // These should match projects from the projects property where you want to use a configuration other than the default
    "MOB": {
      url: "https://jira.concur.com/jira/browse/",
      jira: {
        user: 'MiroslavK', // be sure to use the username, not the user email
        password: '<password>',
        host: 'jira.concur.com',
        protocol: 'https',
        port: 443,
        version: '2',
        verbose: true,
        strictSSL: true
      }
    },
  },
  search_cmd: "search",
  //Since search results can be verbose, you may not want to muddy the channel
  search_output_chan: "this",//if the value is "this", then the current channel will be used, else the name of a channel
  projects: ["MOB"],
  post: true,
  verbose: true,
  custom_texts: {
    messagePrefix: "Hey, thought this might help: " //message you might like to prefix to JiraBot's post
  },
  emoji: ":jira:", // be sure to upload your custom emoji in slack
  link_separator: ", ",// use \n if you want new lines
  error_channel: '' //the id of the channel to send low level log errors.  If not defined, will use the current channel
};

//DO NOT EDIT BELOW HERE
var slackbot = new slackbot.Bot(config);
slackbot.run();
@gsingers
Copy link
Owner

Hmm, you might be hitting a bug in the underlying JIRA library itself in that it doesn't handle paths on the URL correctly right now. I think there is a patch for the library, but I haven't tried it myself yet.

@vbouchet31
Copy link

Just my 2 cent insight. I had the same error. I searched for the string "Invalid issue number" in the jira.js library. Before the dorequest method, I added the callback(options.uri); line to check which url was used to do the request.

Based on your current configuration, the url may be https://jira.concur.com:443/rest/api/2/issue/MOB-27579 but you probably want to target https://jira.concur.com:443/jira/rest/api/2/issue/MOB-27579 (try it in a browser).

To do so, I used the port as a workaround:
port: '443/jira

and voila, it worked.

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants