Skip to content

Instantly share code, notes, and snippets.

@noteed
Last active January 30, 2021 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noteed/a4f62742a23d957b81a43d9ef3cff75b to your computer and use it in GitHub Desktop.
Save noteed/a4f62742a23d957b81a43d9ef3cff75b to your computer and use it in GitHub Desktop.
Learn Jira

Learn Jira

I'm trying go-jira, but there is also jira-cli in Python.

I've generated an API token at https://id.atlassian.com/manage-profile/security/api-tokens and pasted it in my password store:

$ pass edit jira/smart-token

I've configured go-jira (in particular to use pass):

$ cat ~/.jira.d/config.yml
endpoint: https://smartjira.atlassian.net
user: thu@smart.coop
password-source: pass
password-name: jira/smart-token

(I've later changed user to login, not sure this makes any difference.)

Then I can check I can authenticate (otherwise this receives a 401):

$ jira session
name: thu
self: https://smartjira.atlassian.net/rest/api/latest/user?username=thu

Listing issues in a specific project

$ jira ls --project DSI --template table | less -S

Creating a new issue

The default template triggers the strict GDPR error message about using the username field.

Use e.g. jira create -p DSI, but in the given template, use emailAddress intead of name. It seems it is also possible to use id.

$ jira create -p DSI
$ jira in-progress DSI-90

I got automatically assigned to the issue. I guess this is because the DSI project is configured that way, not because of go-jira.

Weirdly I can't jira todo the issue after, but I can in the web interface.

Other commands

$ jira view DSI-90
$ jira comment DSI-90
$ jira done DSI-90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment