gsingers / slack-jira-plugin

A Slack plugin that watches channels for messages about JIRA and acts accordingly
MIT License
252 stars 83 forks source link

Trouble getting running #10

Closed lacymorrow closed 8 years ago

lacymorrow commented 9 years ago

Hi, the readme is pretty straightforward but doesn't dive deep into how to fix issues should they be encountered. Here is my config, it creates an API for MYPROJECT but I can't get it to post anything to slack when issues or urls are mentioned.

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

var config = {

  showIssueDetails: true,
  showDetailsByDefault: true,//if true, you don't need the '+' to get details
  bot_name: "<My slack name>",//Provide the name to post under
  token: '<token>, // https://api.slack.com/web
  jira_urls: {
    // DEFAULT NODE IS REQUIRED.
    "DEFAULT": {url: "https://invitae.jira.com/browse/"},
    // These should match projects from the projects property where you want to use a configuration other than the default
    "MYPROJECT": {
      url: "https://myproject.jira.com/browse/",
      jira: {
        user: '<username>', // be sure to use the username, not the user email
        password: '<password>',
        host: 'hostname',
        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: ["MYPROJECT"],
  post: true,
  verbose: true,
  emoji: ":squirrel:", // 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();
sdelmas commented 9 years ago

This may just be a matter of you editing the config file for posting, but

token: '<token>, // https://api.slack.com/web

is definitively wrong. There is a missing ' after the string (which of course would be your slack security token).

lacymorrow commented 9 years ago

Yeah, that's from me editing to hide my config token. Thanks for taking a look though!

gsingers commented 8 years ago

@lacymorrow I think url: "https://myproject.jira.com/browse/", is the culprit. Unfortunately, the JIRA library I am using can't handle paths in the URL right now. I believe there is a patch but it hasn't been released.