Coder Social home page Coder Social logo

keepcosmos / terjira Goto Github PK

View Code? Open in Web Editor NEW
863.0 23.0 38.0 1.93 MB

Terjira is a very interactive and easy to use CLI tool for Jira.

License: MIT License

Ruby 99.42% Shell 0.58%
jira cli command-line command-line-app command-line-tool prompt agile third-party-libraries hacktoberfest

terjira's Introduction

Gem Version Build Status Test Coverage Code Climate

Terjira

Terjira is an interactive and easy to use command line interface (or Application) for Jira. You do not need to remember the resource key or id. Terjira suggests it with an interactive prompt.

Your Jira must support Rest API 2.0 and Agile Rest API 1.0.

Demo

Watch full demo

Sample

Installation

Install it yourself as:

$ gem install terjira

If you have permission problem,

$ sudo gem install terjira

# or

$ gem install terjira --user-install
# You need to export your gem path

Usage

Authentication:
  jira login                         # Login your Jira using your Jira email & password 
                                     # for Server or API token for Cloud.
                                     # Refer: https://confluence.atlassian.com/cloud/api-tokens-938839638.html
                                     #   [--ssl-config]  with ssl configuration
                                     #   [--proxy-config] with proxy configuration
  jira logout                        # Logout your Jira

Project:
  jira project help [COMMAND]        # Describe one specific subcommand
  jira project ( ls | list )         # List of all projects
  jira project [PROJECT_KEY]         # Show detail of the project

Board:
  jira board help [COMMAND]          # Describe one specific subcommand
  jira board ( ls | list)            # List of all boards
  jira board backlog                 # Backlog from the board


Sprint:
  jira sprint help [COMMAND]         # Describe one specific subcommand
  jira sprint ( ls | list )          # List of all sprint from the board
  jira sprint [SPRINT_ID]            # Show the sprint
  jira sprint active                 # Show active sprints and issues
                                     #   To show issues on the sprint(include no assignee)
                                     #   pass `--assignee ALL` or `-a ALL`.

Issue:
  jira issue help [COMMAND]          # Describe one specific subcommand
  jira issue ( ls | list )           # List of issues
                                     #   Default assignee option is current logged-in user
                                     #   To show issues of all users(include no assignee)
                                     #   pass `--assignee ALL` or `-a ALL`.
  jira issue jql "[QUERY]"           # Search issues with JQL
                                     # ex)
                                     #   jira issue jql "project = 'TEST' AND summary ~ 'authentication'"
  jira issue search "[SUMMARY]"      # Search for an issues by summary
  jira issue [ISSUE_KEY]             # Show detail of the issue
  jira issue assign [ISSUE_KEY] ([ASSIGNEE])  # Assign the issue to user
  jira issue attach_file [ISSUE_KEY] ([FILE_PATH])  #Attach a file to issue
  jira issue comment [ISSUE_KEY]     # Write comment on the issue
                                     #   pass `-E` or `--editor` to open system default editor for composing comment
  jira issue edit_comment [ISSUE_KEY] ([COMMENT_ID])     # Edit user's comment on the issue.
                                     #   If COMMENT_ID is not given, it will choose user's last comment.
  jira issue delete [ISSUE_KEY]      # Delete the issue
  jira issue edit [ISSUE_KEY]        # Edit the issue
                                     #   pass `-E` or `--editor` to open system default editor for composing issue description
  jira issue new                     # Create an issue
                                     #   pass `-E` or `--editor` to open system default editor for composing issue description
  jira issue open [ISSUE_KEY]        # Open browser
  jira issue url [ISSUE_KEY]         # Return url of the issue
  jira issue take [ISSUE_KEY]        # Assign the issue to self
  jira issue trans [ISSUE_KEY] ([STATUS])     # Do transition

Feature Todo

Contributions are welcome!

  • Add JQL command for find issues
  • Search issues by keyword
  • Manage worklog and estimate of issues
  • Manage component and version of issues
  • Track history of transitions
  • More friendly help

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rspec spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/keepcosmos/terjira. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

terjira's People

Contributors

dependabot[bot] avatar ezracelli avatar ghosteathuman avatar keepcosmos avatar kimpers avatar mathieugagne avatar supersimple avatar taufek avatar watsy0007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terjira's Issues

Transition issue through multiple steps

Hello

Would it be possible to transition issue through multiple steps when doing jira issue trans ?
I'm asking if it's doable from the API point of view, and if you would have that in the project.

If the answer is yes, I could give it a try, I'm spending quite some time in my work moving jira tasks around.

EDIT

I will often cleanup some boards and put multiple issues to final stage to "DONE". So I would like to add batch transitions through multiple steps to the question : ). Maybe this could be new feature? I would still be happy to implement it.

Parse issue detail error

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse': 757: unexpected token at '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops, you&#39;ve found a dead link. - JIRA</title><script type="text/javascript">contextPath = "";</script><link type='text/css' rel='stylesheet' href='/static-assets/metal-all.css' media='all'><script src='/static-assets/metal-all.js'></script><!--[if lt IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie.css' media='all'><script src='/static-assets/metal-all-ie.js'></script><![endif]--><!--[if IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie9.css' media='all'><![endif]--><meta name="decorator" content="none" /></head><body class=" error-page error404"><script type="text/javascript">document.body.className += " js-enabled";</script><div id="page"><header id="header" role="banner"></header><!-- #header --><section id="content" role="main"><div class="aui-page-panel"><div class="aui-page-panel-inner"><section class="aui-page-panel-content lowerContent"><div id="error-state"><span class="error-type"></span><h1>Oops, you&#39;ve found a dead link.</h1><ul><li>Go back to the <a href="javascript:window.history.back()">previous page</a></li><li>Go to the <a href="/secure/MyJiraHome.jspa">Home Page</a></li></ul></div></section><!-- .aui-page-panel-content --></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section><!-- #content --><footer id="footer" role="contentinfo"><section class="footer-body"> (JSON::ParserError)


<ul class="atlassian-footer">
    <li>
        Atlassian JIRA <a class="seo-link" href="https://www.atlassian.com/software/jira">Project Management Software</a>



        <span id="footer-build-information">(v6.3.6#6336-<span title='cf1622c62a612607f341bda9491a04918e09ebfd' data-commit-id='cf1622c62a612607f341bda9491a04918e09ebfd}'>sha1:cf1622c</span>)</span>
    </li>
    <li>
        <a id="about-link" href="/secure/AboutPage.jspa">About JIRA</a>
    </li>
    <li>
                        <a id="footer-report-problem-link" href="/secure/CreateIssue!default.jspa">Report a problem</a>
    </li>
</ul>
<div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div></section></footer><!-- #footer --></div><!-- #page --></body></html>'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse'
	from /Library/Ruby/Gems/2.0.0/gems/terjira-0.3.6/bin/jira:14:in `rescue in <top (required)>'
	from /Library/Ruby/Gems/2.0.0/gems/terjira-0.3.6/bin/jira:9:in `<top (required)>'
	from /usr/local/bin/jira:23:in `load'
	from /usr/local/bin/jira:23:in `<main>'

Ability to Edit User's Comment in Issue

I find it is useful to be able to go back to your previous comment and edit them.

Especially when you are writing a long text such as "testing or reproduction steps" to explain your ticket.

It will be a good addition to this tool.

Format/column for issues status

Small enhancement request: when I pull a list of issues, the Status is formatted as standard text right next to the title, which is less readable:
screen shot 2017-10-04 at 5 03 40 pm

Perhaps it should get its own column? Or maybe bolded, and followed with a ":"

OS X gem install issues

sass/sass#1768

OSX 10.11+ has a security feature that prevents modification of Rootless system files.

this works
sudo gem install -n /usr/local/bin terjira

this does not:
sudo gem install terjira

Add story points to issue

Hi, first nice gem, i started to use it and its cool. But will be more cool if story points will be visible. :)

Feature request: jira issue comment <ticket> should open vim

Hi,

I would like to request that when commenting an issue, to have vim open up, add the comments there, and after closing vim to send the contents as comment for the issue.
My main trouble with doing "jira issue comment " is that after entering a line, I cannot go back and edit it.

Do you think this would be possible? Thanks

jira issue open with extra slash

jira issue open TEST-111 will open https://jira.xxx.com///browse/TES-111 instead of correct address is https://jira.xxx.com/browse/TES-111

Nothing happens on `issue edit [ISSUE_KEY]`

Hi there,

Good works on terjira. Really helpful app.

I have a problem right now. Nothing is happening after I execute issue edit [ISSUE_KEY].

What could be possibly wrong?

I have set my $EDITOR.

Proxy configuration result in end of file reached

I tried to configure terjira with an proxy option, which is a local SSH tunnel SOCKS proxy. But at the end of the configuration I receive the message end of file reached. The configuration isn't saved.

Full output:

 » jira login --proxy-config
Login will be required...
Site: https://random.example.com
Context path: 
Username: [email protected]
Password: ••••••••••••
Proxy address:  127.0.0.1
Proxy port:  7070
end of file reached

Credentials file permission

I see that under ~/.terjira, the file which contains the login credentials has group read permissions. I'd suggest that this should only be readable by the current user since no one else should have access to the password.

[bug] problem with parsing commandline arguments

Looks like terjira has a problem with parsing commandline arguments (or unicode in them):

$ jira issue new -P Low -a mva -S '[Трекер] Конфиги веб-серверов (см. описание)' -d 'Необходимо пройтись по серверам (начиная с servername) и переделать конфигурации NginX и PHP-FPM на более пригодные для автоматизации управления конфигами' -p ADMIN
Choose issue type? Внедрение новой технологии
project: project is required # <- !! (-p was specified! But okay, let's remove it and set it interactively)

$ jira issue new -P Low -a mva -S '[Трекер] Конфиги веб-серверов (см. описание)' -d 'Необходимо пройтись по серверам (начиная с servername) и переделать конфигурации NginX и PHP-FPM на более пригодные для автоматизации управления конфигами'
Choose project? ADMIN - Server administration
Choose issue type? Внедрение новой технологии
summary: Operation value must be a string, description: Operation value must be a string

Pretty the same with posting comments from commandline arguments (both by issue comment and by issue trans -m). In both ways it fails to post comment (in trans it just ignores it, and in comment it throws error and requires to post interactively).

By the way, it probably must be reported as separate issue, but "intercative" mode in issue comment has issue with long lines (when you wrote a line longer then terminal window width, it duplicate the line many times (once for every time you type new letter)

Output Option(s)

Can you please add an option to remove all the unnecessary formatting from all output? It would be useful to have only text output that can be more easily parsed. Currently I have to hack the output with the following:

Remove ASCII Table:

jira issue jql 'search' | awk '/(.*)-([0-9]+)/{print $0}' | tr -d '│'

Remove colors:

perl -pe 's/\x1b\[[0-9;]*[a-zA-Z]//g'

This also makes me lose the line that describes the "Issue Type" however the tables and colors make it very difficult to wrap tools around this program in order to process output/generate reports etc.

Great tool otherwise though, thank you!

Pass field values when creating a new issue

Hi Guys,

I am facing a little bit of a problem when creating issues.

The workflow for my project requires several different fields be entered before an issue can be created. Would it be possible for the prompt to ask if any fields need to be filled in before creating the issue?

example of issue:

customfield_10004: Story Points is required.

Example of proposed solution:

--extrafield="customfield_10004=3"

jira <issue|sprint> ls report '301 Moved Permanently' error

Hi there,

for some reasons when I send the command

jira sprint ls

or

jira issue ls

I receive the following message:

/usr/lib/ruby/2.3.0/json/common.rb:156:in `parse': 784: unexpected token at '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> (JSON::ParserError)
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://jira.melexis.com/jirarest/agile/1.0/board?">here</a>.</p>
<hr>
<address>Apache/2.2.16 (Debian) Server at jira.melexis.com Port 443</address>
</body></html>
'
        from /usr/lib/ruby/2.3.0/json/common.rb:156:in `parse'
        from /var/lib/gems/2.3.0/gems/terjira-0.3.3/bin/jira:14:in `rescue in <top (required)>'
        from /var/lib/gems/2.3.0/gems/terjira-0.3.3/bin/jira:9:in `<top (required)>'
        from /usr/local/bin/jira:22:in `load'
        from /usr/local/bin/jira:22:in `<main>'

Any idea why? Anything related to my Jira server configuration?

summary: Operation value must be a string

Hi I'm trying to create an issue and I'm getting an this error:

Choose project? TB - keeping
Choose issue type? Bug
Summary? Fix month sum calculation
summary: Operation value must be a string

Fetch (and/or print content to stdout) issue attachments

Hi there!
Thanks for such a pretty useful tool that helps to increase performance in work with JIRA, but it seems like terjira can't fetch files from attachments, and, what will also be useful, print their content to stdout.

I guess, the latter thing can be achieved by something like downloading specified file (from specified issue attachments) to ram or tempfile, and then throw the content in stdout. In that case it can be handled by nothing (text files) or less or vim or whatever, display (imgs), catdoc, and so on.

And for just downloading - I guess, it should be possible to specify download directory (preferrable), or, at least, use XDG dirs

The backlog is not available on Kanban boards

Thanks for this tool, it's really neat!

I'm trying to list the backlog for my Kanban boards and getting The backlog is not available on Kanban boards but in fact this feature was recently added to JIRA... would it be possible for terjira to support it as well?

`jira issue ls` returns errors

The command works, I guess, but the errors seem to have to do with our Jira configuration. The result is, I cannot list issues:

~ % jira issue ls

Der Wert 'Aufgaben' existiert nicht für das Feld 'statusCategory'.
Der Wert 'In Arbeit' existiert nicht für das Feld 'statusCategory'.
Der Wert 'Keine Kategorie' existiert nicht für das Feld 'statusCategory'.

The errors are in German. I could translate them if you need me to.

vim keybindings

Would be nice to navigate lists with j and k

It's quite standard for cli projects like this, so would be an asset to the project.

Sprint command doesn't list issues

Loving terjira so far! I'm trying to set up an easy way to pull my team's current backlog (easily done with (jira board backlog -b BOARD_ID), and active sprint items. It doesn't seem possible to get issues under a current sprint:

$ jira sprint active -b 1382 -a ALL
3278. Grand-Fermage  Active
Tue Sep 12 13:40:43 2017 ~ Fri Sep 29 20:47:00 2017

I've tried every possible combination, but no issues show up. Seems like a bug?

Thanks for doing this amazing project!

Add pull-request links

Is there any thought to show the pull-request links according with the task if it exists?

jira issue comment drops characters - i.e. $

Attempts to create a comment on an issue with the following syntax result in all characters immediately following the $ being dropped.

jira issue comment <ISSUE#> -m "OPS$HRT blah blah blah"

The $HRT is dropped from the comment, presumably because $ is being interpreted as a special character, but it should be ignored since it's contained within a string.

`jira issue new` throwing an error

Running tejira 0.3.2. Finding it less than immediately obvious to discover what version of Jira Rest API and Agile Rest API is running so apologies in advance if this is likely to be the problem.

jira issue new

Choose project? (Use arrow keys, press Enter to select)
‣ ADM - Admin
  DEV - Development

Choose project? ADM - Admin
default index `1` out of range (1 - 0)

The same error is thrown for either selection. List commands are working however and some of the other stuff (e.g. commenting).

jira issue [ISSUE_KEY] fails

Hi,

Trying to run this command, I get;

jira issue XXX-XXX   16:52:04 
/home/developer/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/json/common.rb:156:in `parse': 784: unexpected token at '<title>Oops, you've found a dead link. - JIRA</title><script type="text/javascript">contextPath = "";</script>

Feature request: get Jira URL for issue

Hi.
I would like to request a new command that would return me the URL for an issue, something like
jira issue url --> https://.atlassian.net/browse/

When doing git commits, we add the URL of the Jira issue as the git comment, and currently just to get the URL I need to visit Jira in a webbrowser. This is the only scenario when I have to access Jira in a browser, otherwise terjira is quite complete and allows me to do everything else from the CLI. Thanks

login

It bothers me that I have to reset my creds. Once I do a login to establish my creds to the jira server I don't want to do it again - because I can never remember what terjira wants for the site and context options. Does site include the protocol or not? Does site only need the domain. What does context path mean? If would be very helpful to forgetful old men to have some example in the documentation or help output.

SSL_connect error

I got the following error at login:
SSL_connect returned=1 errno=0 state=error: certificate verify failed

jira issue ls - Error

Executing jira issue ls or jira issue list results in

The value 'To Do' does not exist for the field 'statusCategory'.

Granted I'm making an assumption here that the query behind this command is looking for a specific value - the aforementioned 'To Do' - can it be adjusted to simply look for any assigned issue, perhaps filtered by status?

I'm using this against a fairly customized install of JIRA, so some of the typical defaults probably aren't present.

default index 1 out of range (1 - 0)

Hi all,

I have logged into my instance of JIRA with the command line and as I went to add an issue I got the following error:

Choose project? test project
default index `1` out of range (1 - 0)```

We recently passed 10,000, is that possibly related?  If so is there a work around?

Thanks

adding issue to sprint?

is there a way of adding an issue to a project's board? I'm not seeing anything in the docs about it

default index 1 out of range (1 - 0)

Hi all,

I have logged into my instance of JIRA with the command line and as I went to add an issue I got the following error:

mferguson$ jira issue new
Choose project? test project
default index `1` out of range (1 - 0)

We recently passed 10,000, is that possibly related? If so is there a workaround?

Thanks

proxy configuration needs exposing

The JIRA:Client that Terjira uses appears to have a proxy that is configurable. It also has a flag to disable TLS chain trust checking. For my corporate use case, I'd need to accept self signed certs and assign a proxy with proxy credentials (user/pass).

I'm on my personal account but I want to introduce this to the development teams being force migrated to Jira at a random fortune 50.

Please add a global --no-color option

Currently when I send output to STDOUT, I get all the color markup as well. This doesn't work out well when I'm trying to generate text content to put into another format/context. Having a global --no-color options gives me the flexibility to see the pretty markup on my console and when I want plain text to get that as well.

Installation on OSX (Darwin 10.12.2 64bit) fails with a dependencies issue

Installation

Tested commands:

  • sudo gem install -n /usr/local/bin terjira
  • gem install terjira

Result

ERROR:  While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: terjira requires pastel (~> 0.6.1); tty-table requires pastel (~> 0.6.0)

Environment

gem --version
2.0.14.1
Darwin 10.12.2 64bit

Error when creating Issue

Hello keepcosmos, I love the potential of this tool! Would absolutely love to work with JIRA via the command line. However, currently there is issue when creating a new issue !

Summary? AAAAA
summary: Operation value must be a string 

Is there is possible fix or reason? Thanks. Also, one should note that if one enters in an email for the username (and successfully authenticates) this error occurs when attempting to list issues

Error in the JQL Query: The character '@' is a reserved JQL character. You must enclose it in a string or use the escape '\u0040' instead. (line 1, character 17)

Does not list all boards

Our organization has a large list of boards. However, jira board ls does not show all of them. Is there a way I can set my active board via a command?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.