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

Setting .project and other variables #495

Open
ns-kvaradhan opened this issue May 4, 2023 · 0 comments
Open

Setting .project and other variables #495

ns-kvaradhan opened this issue May 4, 2023 · 0 comments

Comments

@ns-kvaradhan
Copy link

          Added named queries into `.jira.d/configs.yml`:
queries:
  todo: |
    resolution = unresolved {{if .project}}AND project = '{{.project}}'{{end}} AND status = 'To Do'
  open: |
    resolution = unresolved {{if .project}}AND project = '{{.project}}'{{end}} AND status = 'Open'

They can be templates and can use command line options and configs to populate:

$ jira ls --named-query todo
...
$ jira ls -n todo -p BASIC
...

Originally posted by @coryb in #99 (comment)

I find that the variables, .project etc. are coming from the top level key/value pairs. But why woudl this not work?

custom-commands:
  - name: sprint list
    help: list issues in a sprint (default active)
    default: true
    options:
      - name: project
        short: p
        default: $JIRA_PROJECT
    script: |
      {{with options}}
      {{jira}} list -n todo
      {{end}}

Looking at verbose output shows this:

/tmp ➜ jira sprint list -p XYZ -v
DEBUG Getting Password
DEBUG password-source: keyring
INFO Querying keyring password source.
INFO Password cached.
DEBUG Request 1: POST /rest/api/2/search HTTP/1.1
Host: netskope.atlassian.net
User-Agent: Go-http-client/1.1
Transfer-Encoding: chunked
Authorization: Basic a3ZhcmFkaGFuQG5ldHNrb3BlLmNvbTpOazBBRGFXV2swQ0VUR2dCYlBRMjMzMkY=
Content-Type: application/json
Accept-Encoding: gzip

b8
{"fields":["summary","assignee","created","priority","reporter","status","summary","updated","issuetype"],"jql":"resolution = unresolved  AND sprint in openSprints()","maxResults":100}
0
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

1 participant