Git Product home page Git Product logo

Comments (12)

steyep avatar steyep commented on August 26, 2024

Hey @seebi, thanks for the feedback and my apologies for the inconvenience. Can you enable debugging within Alfred and post the feedback it gives you when trying to login? I'd like to get the bigger picture resolved as well.

The login process handles a few steps behind the scenes that make the workflow run more efficiently so it's not quite as simple as just creating the config file. My sneaking suspicion is that node is not on your $PATH from Alfred's perspective.

Try this (from the directory you cloned the repo to):

node lib/action.js login

from alfred-jira.

seebi avatar seebi commented on August 26, 2024

Hey @steyep - this worked just fine without any changes, just the command line. Thanks for the hint, I just gave you a PR in order to preserve this for others ...

from alfred-jira.

steyep avatar steyep commented on August 26, 2024

Cool, I'm glad that worked for you but that gives credence to my theory that Alfred isn't finding node on your $PATH. Would you mind attempting to open the workflow settings (jira ► settings ► Edit Settings) and let me know if you're able to do so?

My fear is that you may experience problems again in the future because there are multiple places in the code that expect npm to be on the $PATH available to Alfred (editing the settings and logging out are among the most significant).

Thanks for the PR. I will review it and work on fixing the problem rather than relying on a workaround.

from alfred-jira.

seebi avatar seebi commented on August 26, 2024

edit settings does not work but I solved that with node lib/action.js editSettings :-)

Can you tell me where to enabled debugging in alfred for the workflow?

from alfred-jira.

steyep avatar steyep commented on August 26, 2024
  • Open Alfred's preferences
  • Select the Jira workflow
  • Select the "bug" icon in the upper right-hand corner
  • Log "All Information"
    debug

from alfred-jira.

seebi avatar seebi commented on August 26, 2024
[2017-03-09 18:24:17][input.scriptfilter] <?xml version="1.0"?>
<items>
  <item valid="no" autocomplete="► tickets ► ">
    <title>My tickets</title>
    <icon>./resources/icons/inbox.png</icon>
  </item>
  <item valid="no" autocomplete="► watched ► ">
    <title>Watched issues</title>
    <icon>./resources/icons/watched.png</icon>
  </item>
  <item valid="no" autocomplete="► search ►  ">
    <title>Search Jira</title>
    <icon>./resources/icons/search.png</icon>
  </item>
  <item valid="no" autocomplete="► settings ► ">
    <title>Settings</title>
    <icon>./resources/icons/config.png</icon>
  </item>
</items>
[2017-03-09 18:24:19][input.scriptfilter] <?xml version="1.0"?>
<items>
  <item valid="no" arg="update">
    <title>Workflow is up-to-date</title>
    <subtitle>Last checked: 3/9/2017, 6:23:29 PM</subtitle>
    <icon>./resources/icons/good.png</icon>
  </item>
  <item valid="yes" arg="editSettings">
    <title>Edit Settings</title>
    <icon>./resources/icons/edit.png</icon>
  </item>
  <item valid="yes" arg="clearCache">
    <title>Clear cache</title>
    <icon>./resources/icons/delete.png</icon>
  </item>
</items>
[2017-03-09 18:24:29][input.scriptfilter] Processing output of 'action.script' with arg 'editSettings'
[2017-03-09 18:24:29][action.script] Processing output of 'output.notification' with arg ''

from alfred-jira.

brandenbyers avatar brandenbyers commented on August 26, 2024

I'm having a similar login issue. And you are correct, node does not appear to be in path for Alfred or this workflow:

Starting debug for 'jira'

[2017-03-09 09:24:34][STDERR: input.scriptfilter] Unable to get options. auth.checkConfig did not pass.
[2017-03-09 09:24:34][input.scriptfilter] <?xml version="1.0"?>
<items>
  <item valid="yes" arg="login">
    <title>Login</title>
    <icon>./resources/icons/login.png</icon>
  </item>
</items>
[2017-03-09 09:24:39][input.scriptfilter] Processing output of 'action.script' with arg 'login'
[2017-03-09 09:24:39][ERROR: action.script] /Users/branden/Projects/alfred-jira/lib/jira/auth.js:19
      if (err) throw err;
               ^

Error: Command failed: /bin/zsh -c "npm run electron login"
zsh:1: command not found: npm

    at ChildProcess.exithandler (child_process.js:202:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)
[2017-03-09 09:24:39][action.script] Processing output of 'output.notification' with arg ''

from alfred-jira.

brandenbyers avatar brandenbyers commented on August 26, 2024

I tried changing /usr/local/bin/node to my local which node in both the script filter and run script for this workflow in Alfred preferences, but it still doesn't work.

Node is installed via nvm on my machine. Is node referenced anywhere else?

Edit: I also tried entering node lib/action.js login on the command line and was able to successfully load the login window. However, the workflow doesn't register that I have already logged in.

Edit 2: I added source ~/.zshrc to both scripts and changed the language to /bin/zsh and was able to successfully log in. But when trying to access my tickets:

[2017-03-09 09:47:02][input.scriptfilter] <?xml version="1.0"?>
<items>
  <item valid="no">
    <title>400: Bad Request</title>
  </item>
</items>

from alfred-jira.

steyep avatar steyep commented on August 26, 2024

Thank you both for the feedback. It's not actually node that's causing the issue. It's npm.

Error: Command failed: /bin/zsh -c "npm run electron login"
zsh:1: command not found: npm

The reason is the same, though. Alfred was unable to find the npm command because the $PATH was different.

I've pushed out a hotfix for this. Could either of you checkout out the hotfix/38-path-not-available-to-alfred branch and let me know if the edits resolve this issue?

from alfred-jira.

brandenbyers avatar brandenbyers commented on August 26, 2024

Yes, I have confirmed that the hotfix solves the login issue.

However, I am still getting an error any time I try to do anything other than edit settings.

[2017-03-09 10:19:11][input.scriptfilter] <?xml version="1.0"?>
<items>
  <item valid="no">
    <title>400: Bad Request</title>
  </item>
</items>

Should I create a new ticket for this issue?

from alfred-jira.

steyep avatar steyep commented on August 26, 2024

@brandenbyers that sounds like an issue authing against your jira instance. Check your settings to make sure that the url is the same as how you access it via the web. One thing to check is that you're using the correct protocol (http vs https). You can toggle the protocol by clicking it in the settings.

ssl

If all of that looks right to you, make sure your account has access to view issues by

  • opening jira in a web browser
  • log in if you aren't already logged in
  • go to { your jira configured url }/rest/api/2/search?jql=assignee=currentUser()

If you're able to see a JSON dump of your issues on the screen, and the URL you entered is the same as what's shown in the settings, then open another issue so that I can help you get it working.

from alfred-jira.

seebi avatar seebi commented on August 26, 2024

@steyep the hot fix solved my issue too - well done! thank you

from alfred-jira.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.