atlassian / gajira-cli

Other
38 stars 17 forks source link

The examples provided do not work 🤔 #20

Open adamjjeffery opened 1 year ago

adamjjeffery commented 1 year ago

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

ERROR Invalid Usage: unknown long flag '--issue'
Kruthika0 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

Same error :)

adamjjeffery commented 1 year ago

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

adamjjeffery commented 1 year ago

Same error :)

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

Kruthika0 commented 1 year ago

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 commented 1 year ago

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

jasonbecker-os commented 1 year ago

@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 commented 1 year ago

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: my-github-actions-jira-bot@mysubdomain.net