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

101 Guide to Starting Up #40

Open jackkeck opened 7 years ago

jackkeck commented 7 years ago

I am trying to start this up in the most basic way possible but having some issues. The documentation around getting started isn't all that clear for me. Below is the startup command I am trying to run. Is there anything glaringly obvious I am missing here? For what it is worth, I'll contribute back to update with a getting started portion to the docs. HUBOT_SLACK_TOKEN=xoxb-XXXXXXX-XXXXXXX HUBOT_GITHUB_ORG=hello HUBOT_GITHUB_TOKEN=there HUBOT_JIRA_GITHUB_DISABLED=true HUBOT_JIRA_PASSWORD=XXX HUBOT_JIRA_PRIORITIES_MAP=[{"name":"Blocker","id":"1"},{"name":"Critical","id":"2"},{"name":"Major","id":"3"},{"name":"Minor","id":"4"},{"name":"Trivial","id":"5"}] HUBOT_JIRA_PROJECTS_MAP={"sys":"SYS"} HUBOT_JIRA_TRANSITIONS_MAP=[{"name":"backlog","jira":"Backlog"},{"name":"devready","jira":"Selected for Development"},{"name":"inprogress","jira":"In Progress"},{"name":"done","jira":"Done"}] HUBOT_JIRA_TYPES_MAP=[{"story":"Story / Feature","bug":"Bug","task":"Task"}] HUBOT_JIRA_URL=https://XXX.atlassian.net HUBOT_JIRA_USERNAME=XXX.XXX 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"}} HUBOT_SLACK_PROJECT_BUTTON_STATE_MAP={"PLAT":{"inprogress":["review","running","resolved"],"review":["running","resolved"],"running":["resolved"],"resolved":["devready","inprogress"],"mention":["watch","assign","devready","inprogress","rank"]},"HAL":{"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"]}} HUBOT_SLACK_VERIFICATION_TOKEN=xoxb-XXXXXX-XXXXX ./bin/hubot --adapter slack

jackkeck commented 7 years ago

Here is the error output: [Tue Jun 27 2017 10:20:25 GMT-0400 (EDT)] INFO hubot-redis-brain: Using default redis on localhost:6379 [Tue Jun 27 2017 10:20:25 GMT-0400 (EDT)] ERROR Unable to load /xxxxxxxx/node_modules/hubot-jira-bot/src/index: SyntaxError: Unexpected token s in JSON at position 1 at JSON.parse (<anonymous>:null:null) at /xxxxxxxx/node_modules/hubot-jira-bot/src/config.coffee:36:5, <js>:30:22 at Object.<anonymous> (/xxxxxxxx/node_modules/hubot-jira-bot/src/config.coffee:21:1, <js>:197:5) at Object.<anonymous> (/xxxxxxxx/node_modules/hubot-jira-bot/src/config.coffee:21:1, <js>:201:4) at Module._compile (module.js:571:32) at Object.loadFile (/xxxxxxxx/node_modules/coffee-script/lib/coffee-script/coffee-script.js:182:19) at Module.load (/xxxxxxxx/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object.<anonymous> (/xxxxxxxx/node_modules/hubot-jira-bot/src/index.coffee:23:10, <js>:8:12) at Object.<anonymous> (/xxxxxxxx/node_modules/hubot-jira-bot/src/index.coffee:20:1, <js>:563:4) at Module._compile (module.js:571:32) at Object.loadFile (/xxxxxxxx/node_modules/coffee-script/lib/coffee-script/coffee-script.js:182:19) at Module.load (/xxxxxxxx/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Robot.loadFile (/xxxxxxxx/node_modules/hubot/src/robot.coffee:355:9, <js>:224:20) at /xxxxxxxx/node_modules/hubot-jira-bot/index.coffee:7:5, <js>:13:22 at FSReqWrap.cb [as oncomplete] (fs.js:240:19)

alexanto09 commented 7 years ago

Hi Place the JSON values inside single quotes for the configurations. Please find the config that I am using : 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"}]' export HUBOT_JIRA_PROJECTS_MAP='{"web":"WEB","android":"AN","ios":"IOS","platform":"PLAT"}' export HUBOT_JIRA_TRANSITIONS_MAP='[{"name":"triage","jira":"Triage"},{"name":"icebox","jira":"Icebox"},{"name":"backlog","jira":"Backlog"},{"name":"devready","jira":"Selected for Development"},{"name":"inprogress","jira":"In Progress"},{"name":"design","jira":"Design Triage"}]' export HUBOT_JIRA_TYPES_MAP='{"story":"Story","bug":"Bug","task":"Task"}' export HUBOT_JIRA_FIELDS='["issuetype","status","assignee","reporter","summary","description","labels","project"]' 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='{"PLAT":{"inprogress":["review","running","resolved"],"review":["running","resolved"],"running":["resolved"],"resolved":["devready","inprogress"],"mention":["watch","assign","devready","inprogress","rank"]},"HAL":{"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"]}}'