Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

First time running gh jira result in error #39

Closed
maxandersen opened this issue Mar 24, 2014 · 5 comments
Closed

First time running gh jira result in error #39

maxandersen opened this issue Mar 24, 2014 · 5 comments
Labels

Comments

@maxandersen
Copy link
Contributor

Following the instructions running gh jira just gives:

/usr/local/lib/node_modules/gh-jira/bin/jira.js:222
    options.assignee = options.assignee || jiraConfig.user;
                                                     ^
TypeError: Cannot read property 'user' of undefined
    at Jira.run (/usr/local/lib/node_modules/gh-jira/bin/jira.js:222:54)
    at /usr/local/lib/node_modules/gh/bin/gh.js:183:34
    at Array.forEach (native)
    at /usr/local/lib/node_modules/gh/bin/gh.js:174:25
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:232:13
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:142:25
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:229:17
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:556:34
    at exports.checkVersion (/usr/local/lib/node_modules/gh/lib/base.js:167:21)
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:551:21

Would be great with some info in the readme about how to actually set this up.

Thanks

@zenorocha
Copy link
Contributor

First, you need to be logged in on GitHub using gh. Then when you try to run any gh-jira command, it will ask for your user/password.

@maxandersen
Copy link
Contributor Author

I am logged into github using gh. I can comment, add, review, etc. that works perfectly.

The above is what happens as soon as I run gh jira. Looking at the code it seems gh-jira assumes username is already present.

Try remove your .json file and see if still works for you ? (just a guess)

@maxandersen
Copy link
Contributor Author

I just tried again. Removed gh jira and reinstalled it. Removed ~/.gh.json and here are what I get when running gh pr:

➜  jbosstools-website git:(master) gh pr                                                                                                                                   (master⚡)
gh First we need authorization to use GitHub's API. Login with your GitHub account.
[?] Enter your GitHub user: maxandersen
[?] Enter your GitHub password: *********
gh [success] Authentication succeed.
gh [success] Writing GH config data: /Users/max/.gh.json
gh [info] Listing open pull requests on jbosstools/jbosstools-website
gh ➜ jbosstools/jbosstools-website
gh   master (4)
gh     #65 JBIDE-16923 - Improve /download index.html layouts @xcoulon (3 days ago)
gh     #64 JBIDE-16785: Forge N&N, include the connection profile news @koentsje (3 days ago)
gh     #55 reworked fuse tooling page (see JBIDE-16697) @lhein (5 days ago)
gh     #32 initial installation doc @maxandersen (a month ago)
gh

So that works. now run gh jira

➜  jbosstools-website git:(master) gh jira                                                                                                                                 (master⚡)

/usr/local/lib/node_modules/gh-jira/bin/jira.js:222
    options.assignee = options.assignee || jiraConfig.user;
                                                     ^
TypeError: Cannot read property 'user' of undefined
    at Jira.run (/usr/local/lib/node_modules/gh-jira/bin/jira.js:222:54)
    at /usr/local/lib/node_modules/gh/bin/gh.js:183:34
    at Array.forEach (native)
    at /usr/local/lib/node_modules/gh/bin/gh.js:174:25
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:232:13
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:142:25
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:229:17
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:556:34
    at exports.checkVersion (/usr/local/lib/node_modules/gh/lib/base.js:167:21)
    at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:551:21

Thus yeah, something is assuming jiraConfig exists before jiraConfig is even added.

@maxandersen maxandersen changed the title Document how to start using this First time running gh jira result in error Apr 1, 2014
@maxandersen
Copy link
Contributor Author

Tried this with very latest update from gh and it is the same thing.

gh works with github, gh-jira fails when .gh.json has no jiraconfig.

@maxandersen
Copy link
Contributor Author

seems new updates being ignored so removing first usage question .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants