gajira-cli icon indicating copy to clipboard operation
gajira-cli copied to clipboard

The examples provided do not work 🤔

Open adamjjeffery opened this issue 3 years ago • 11 comments

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

ERROR Invalid Usage: unknown long flag '--issue'

adamjjeffery avatar Dec 06 '22 15:12 adamjjeffery

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

Kruthika0 avatar Dec 07 '22 06:12 Kruthika0

@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.

adamjjeffery avatar Dec 07 '22 07:12 adamjjeffery

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

Kruthika0 avatar Dec 07 '22 09:12 Kruthika0

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 }}

adamjjeffery avatar Dec 07 '22 09:12 adamjjeffery

Same error :)

Kruthika0 avatar Dec 07 '22 09:12 Kruthika0

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

adamjjeffery avatar Dec 07 '22 09:12 adamjjeffery

Same error :)

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

adamjjeffery avatar Dec 07 '22 09:12 adamjjeffery

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 avatar Dec 07 '22 09:12 Kruthika0

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

Kruthika0 avatar Dec 07 '22 12:12 Kruthika0

@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 avatar Sep 18 '23 18:09 jasonbecker-os

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]

jasonbecker-os avatar Sep 19 '23 16:09 jasonbecker-os