Skip to content

Setting .project and other variables #495

Description

@ns-kvaradhan
          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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions