hubot-jira-bot icon indicating copy to clipboard operation
hubot-jira-bot copied to clipboard

json error

Open murali2020kris opened this issue 7 years ago • 1 comments

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.

murali2020kris avatar Jun 05 '17 19:06 murali2020kris

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"}'

vwbusguy avatar Jul 10 '17 18:07 vwbusguy