ndaversa / hubot-jira-bot

Lets you search for JIRA tickets, open them, transition them thru different states, comment on them, rank them up or down, start or stop watching them or change who is assigned to a ticket. Also, notifications for assignments, mentions and watched tickets.
https://www.npmjs.com/package/hubot-jira-bot
MIT License
61 stars 43 forks source link

Parsing fails for Projects list #27

Closed pdeast closed 7 years ago

pdeast commented 7 years ago

I have been unsuccessful in getting the bot to start properly. Always results in the following error and the Unexpected Token is the "E" in "Engineering"

[Thu Feb 16 2017 00:03:40 GMT+0000 (UTC)] ERROR Unable to load /vagrant/node_modules/hubot-jira-bot/src/index: SyntaxError: Unexpected token E
  at Object.parse (native)
  at /vagrant/node_modules/hubot-jira-bot/src/config.coffee:36:5, <js>:30:22
  at Object.<anonymous> (/vagrant/node_modules/hubot-jira-bot/src/config.coffee:21:1, <js>:197:5)
  at Object.<anonymous> (/vagrant/node_modules/hubot-jira-bot/src/config.coffee:21:1, <js>:201:4)
  at Module._compile (module.js:410:26)
  at Object.loadFile (/vagrant/node_modules/coffee-script/lib/coffee-script/coffee-script.js:182:19)
  at Module.load (/vagrant/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36)
  at Function.Module._load (module.js:301:12)
  at Module.require (module.js:354:17)
  at require (internal/module.js:12:17)
  at Object.<anonymous> (/vagrant/node_modules/hubot-jira-bot/src/index.coffee:23:10, <js>:8:1

Below is the startup script I am using

#!/bin/bash
export HUBOT_GITHUB_ORG=none
export HUBOT_GITHUB_TOKEN=none 
export HUBOT_JIRA_GITHUB_DISABLED=true 
export HUBOT_JIRA_PASSWORD=XXXXXXXXX 
export HUBOT_JIRA_PRIORITIES_MAP=[{"name":"Highest","id":"1"},{"name":"High","id":"2"},{"name":"Medium","id":"3"},{"name":"Low","id":"4"},{"name":"Lowest","id":"5"}] 
export HUBOT_JIRA_TYPES_MAP={"story":"Story","feature":"Feature","bug":"Bug","task":"Task","subtask":"Sub-task","epic":"Epic"} 
export HUBOT_JIRA_URL=https://jira.............com 
export HUBOT_JIRA_USERNAME=YYYYYYYYYY 
export HUBOT_SLACK_BUTTONS={"watch":{"name":"watch","text":"Watch","type":"button","value":"watch","style":"primary"},"assign":{"name":"assign","text":"Assign to me","type":"button","value":"assign"},"devready":{"name":"devready","text":"Dev Ready","type":"button","value":"selected"},"inprogress":{"name":"inprogress","text":"In Progress","type":"button","value":"progress"},"rank":{"name":"rank","text":"Rank Top","type":"button","value":"top"},"running":{"name":"running","text":"Running","type":"button","value":"running"},"review":{"name":"review","text":"Review","type":"button","value":"review"},"resolved":{"name":"resolved","text":"Resolved","type":"button","style":"primary","value":"resolved"},"done":{"name":"done","text":"Done","type":"button","style":"primary","value":"done"}} 
export HUBOT_SLACK_PROJECT_BUTTON_STATE_MAP={"EN":{"inprogress":["review","running","resolved"],"review":["running","resolved"],"running":["resolved"],"resolved":["devready","inprogress"],"mention":["watch","assign","devready","inprogress","rank"]},"default":{"inprogress":["review","done"],"review":["done"],"done":["devready, inprogress"],"mention":["watch","assign","devready","inprogress","rank"]}} 
export HUBOT_JIRA_PROJECTS_MAP={"Engineering":"EN"}
export HUBOT_JIRA_DEFAULT_PROJECT=EN
export HUBOT_SLACK_VERIFICATION_TOKEN=xoxb-XXXXXX
export HUBOT_SLACK_TOKEN=xoxb-XXXXXX
export HUBOT_LOG_LEVEL=debug
./bin/hubot --adapter slack

package.json

{
  "name": "test-hubot",
  "version": "0.0.0",
  "private": true,
  "author": "Paul East <paul@xxxxx.com>",
  "description": "A helpful robot",
  "dependencies": {
    "hubot": "^2.19.0",
    "hubot-diagnostics": "0.0.1",
    "hubot-google-images": "^0.2.6",
    "hubot-google-translate": "^0.2.0",
    "hubot-help": "^0.2.0",
    "hubot-heroku-keepalive": "^1.0.2",
    "hubot-jira-bot": "^7.3.0",
    "hubot-maps": "0.0.2",
    "hubot-pugme": "^0.1.0",
    "hubot-redis-brain": "0.0.3",
    "hubot-rules": "^0.1.1",
    "hubot-scripts": "^2.17.2",
    "hubot-shipit": "^0.2.0",
    "hubot-slack": "^4.3.1"
  },
  "engines": {
    "node": "0.10.x"
  }
}
ndaversa commented 7 years ago
export HUBOT_JIRA_PROJECTS_MAP={"Engineering":"EN"}
bash-3.2$ echo $HUBOT_JIRA_PROJECTS_MAP
{Engineering:EN}

You need to escape the quotes here I think