Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The examples provided do not work 🤔 #20

Open
adamjjeffery opened this issue Dec 6, 2022 · 11 comments
Open

The examples provided do not work 🤔 #20

adamjjeffery opened this issue Dec 6, 2022 · 11 comments

Comments

@adamjjeffery
Copy link

The example provided here simply fails with the following error...

ERROR Invalid Usage: unknown long flag '--issue'
@Kruthika0
Copy link

Same for me. Also need some insights on using jira list. I am trying to list issues with a specific summary. But none of the specified options work

@adamjjeffery
Copy link
Author

adamjjeffery commented Dec 7, 2022

@Kruthika0 - Try this instead...

- name: Setup
   uses: atlassian/gajira-cli@v3
   with:
      version: 1.0.27

- name: Check ticket does not already exist
   id: find
   env:
      JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
      JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
      JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
   run: jira list --query "resolution=unresolved AND issuetype=Task AND summary~'${{ github.event.pull_request.title }}' AND project=ABC" --queryfields=issuetype,summary,priority,assignee,status,created,reporter,summary

It uses the ~ to see if the summary contains the given string.

@Kruthika0
Copy link

@adamjjeffery I get this when I try the above - ERROR Invalid Usage: Post "rest/api/2/search": unsupported protocol scheme ""
Despite providing JIRA_HOST

@adamjjeffery
Copy link
Author

Try using these env vars instead, setting the JIRA_BASE_URL...

JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

@Kruthika0
Copy link

Same error :)

@adamjjeffery
Copy link
Author

Looks you're going to have to do some Googling mate ;)

@adamjjeffery
Copy link
Author

Same error :)

Are you providing the "https://" in your base url?

@Kruthika0
Copy link

Same error :)

Are you providing the "https://" in your base url?

Yes!! Strangest thing is if I manually visit that URL from the browser, I am able to view the data. When I use gh-actions then I get this issue.

@Kruthika0
Copy link

@adamjjeffery - I was doing a very trivial mistake. Got it resolved :) Thank you!

@jasonbecker-os
Copy link

@adamjjeffery - I was doing a very trivial mistake. Got it resolved :) Thank you!

@Kruthika0 I'm having the exact same issue. Can you share what your fix was?

@jasonbecker-os
Copy link

jasonbecker-os commented Sep 19, 2023

Just got it working for myself. For posterity, it seems the gajira-cli does not support the JIRA_BASE_URL or JIRA_USER_EMAIL environment variables. Instead I had to set endpoint and user in my .jira.d/config.yml file, like so:

endpoint: https://mysubdomain.atlassian.net
user: [email protected]

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

No branches or pull requests

3 participants