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

json error #36

Open murali2020kris opened 7 years ago

murali2020kris commented 7 years ago

When trying to install - I get this error message : (same as issue #4)

export HUBOT_JIRA_PROJECTS_MAP={"web":"WEB","android":"AN","ios":"IOS","platform":"PLAT"} export HUBOT_JIRA_TYPES_MAP={"story":"Story","SupportIncident":"Support Incident","SupportTicket":"Support Ticket"} export HUBOT_JIRA_PRIORITIES_MAP=[{"name":"Blocker","id":"1"},{"name":"Critical","id":"2"},{"name":"Major","id":"3"},{"name":"Minor","id":"4"},{"name":"Trivial","id":"5"}]

ERROR Unable to load /home/mkrish6/tars/node_modules/hubot-jira-bot/src/index: SyntaxError: Unexpected token w in JSON at position 1 at Object.parse (native) at /home/mkrish6/tars/node_modules/hubot-jira-bot/src/config.coffee:36:5, :30:22 at Object. (/home/mkrish6/tars/node_modules/hubot-jira-bot/src/config.coffee:21:1, :197:5) at Object. (/home/mkrish6/tars/node_modules/hubot-jira-bot/src/config.coffee:21:1, :201:4) at Module._compile (module.js:570:32) at Object.loadFile (/home/mkrish6/tars/node_modules/coffee-script/lib/coffee-script/coffee-script.js:182:19) at Module.load (/home/mkrish6/tars/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/home/mkrish6/tars/node_modules/hubot-jira-bot/src/index.coffee:23:10, :8:12) at Object. (/home/mkrish6/tars/node_modules/hubot-jira-bot/src/index.coffee:20:1, :563:4) at Module._compile (module.js:570:32) at Object.loadFile (/home/mkrish6/tars/node_modules/coffee-script/lib/coffee-script/coffee-script.js:182:19) at Module.load (/home/mkrish6/tars/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Robot.loadFile (/home/mkrish6/tars/node_modules/hubot/src/robot.coffee:355:9, :224:20) at /home/mkrish6/tars/node_modules/hubot-jira-bot/index.coffee:7:5, :13:22 at FSReqWrap.cb [as oncomplete] (fs.js:257:19)

please suggest a sample config set for json that works.

vwbusguy commented 7 years ago

It took me several attempts to get the ENV configs right as well. In the case you are seeing, I believe I had to escape the special characters in the string on the export when running directly from CLI.

If Ansible+Docker is an option for you, I was able to set the envs like:

HUBOT_JIRA_TYPES_MAP: '{"story":"Story / Feature","bug":"Bug","task":"Task"}'