├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── LICENSE.md ├── README.md ├── bin ├── jira.js └── tests.sh ├── gulpfile.js ├── lib ├── auth.js ├── ca.js ├── common.js ├── config.js ├── initial_config.js ├── jira │ ├── addToSprint.js │ ├── assign.js │ ├── comment.js │ ├── create.js │ ├── describe.js │ ├── edit.js │ ├── fix.js │ ├── link.js │ ├── ls.js │ ├── new.js │ ├── release.js │ ├── send.js │ ├── sprint.js │ ├── transitions.js │ ├── watch.js │ └── worklog.js ├── prompt.js ├── settings.js ├── ssl_request.js └── utils.js ├── package-lock.json ├── package.json └── test └── unit └── utils ├── file-api.spec.js └── format-api.spec.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | max_line_length = 120 10 | tab_width = 2 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | es6: true, 4 | node: true, 5 | }, 6 | globals: {}, 7 | rules: { 8 | semi: ['error', 'always'], 9 | 'no-cond-assign': ['error', 'except-parens'], 10 | camelcase: 'error', 11 | curly: 'off', 12 | eqeqeq: 'error', 13 | 'no-eq-null': 'error', 14 | 'no-eval': 'off', 15 | 'wrap-iife': 'off', 16 | indent: [ 17 | 'error', 18 | 2, 19 | { 20 | SwitchCase: 1, 21 | }, 22 | ], 23 | 'no-use-before-define': 'off', 24 | 'linebreak-style': ['error', 'unix'], 25 | 'comma-style': ['error', 'last'], 26 | complexity: ['error', 15], 27 | 'max-depth': ['error', 4], 28 | 'max-statements': ['error', 25], 29 | 'new-cap': 'error', 30 | 'no-empty': [ 31 | 'error', 32 | { 33 | allowEmptyCatch: true, 34 | }, 35 | ], 36 | 'no-new': 'off', 37 | quotes: ['error', 'single'], 38 | strict: 'off', 39 | 'no-undef': 'error', 40 | 'no-unused-vars': 'error', 41 | 'eol-last': 'error', 42 | 'key-spacing': [ 43 | 'error', 44 | { 45 | beforeColon: false, 46 | afterColon: true, 47 | }, 48 | ], 49 | 'no-trailing-spaces': 'error', 50 | 'space-infix-ops': 'error', 51 | 'keyword-spacing': ['error', {}], 52 | 'space-unary-ops': [ 53 | 'error', 54 | { 55 | words: false, 56 | nonwords: false, 57 | }, 58 | ], 59 | 'brace-style': [ 60 | 'error', 61 | '1tbs', 62 | { 63 | allowSingleLine: true, 64 | }, 65 | ], 66 | }, 67 | 'overrides': [ 68 | { 69 | 'files': [ 70 | '**/*.spec.js', 71 | '**/*.spec.jsx' 72 | ], 73 | 'env': { 74 | 'jest': true 75 | } 76 | } 77 | ] 78 | 79 | } 80 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .jira-cmd 4 | .jira-cli 5 | .**.swp 6 | .idea 7 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Dan Shumaker 4 | Copyright (c) 2017 Germán Robledo 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | jira-cli 2 | ======== 3 | 4 | [![NPM Version](https://badge.fury.io/js/jira-cli.svg)](https://npmjs.org/package/jira-cli) 5 | [![Package downloads](http://img.shields.io/npm/dm/jira-cli.svg)](https://npmjs.org/package/jira-cli) 6 | [Jira API Reference](https://docs.atlassian.com/software/jira/docs/api/REST/8.1.0/) 7 | 8 | A Jira command line interface (forked from https://github.com/germanrcuriel/jira-cmd ) 9 | 10 | ## Deprecation Notice / Maintenance Transfer to Fork 11 | 12 | - This repo is deprecated and no longer maintained. 13 | 14 | - Please see https://github.com/palashkulsh/jira-cmd for all future requests and features. 15 | 16 | - Sincere thanks to Palash and all those who contributed to this fork while it lasted. 17 | -------------------------------------------------------------------------------- /bin/jira.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | // 3 | // Main API : https://docs.atlassian.com/software/jira/docs/api/REST/8.1.0/ 4 | // Creating Issues: https://developer.atlassian.com/jiradev/jira-apis/about-the-jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-examples#JIRARESTAPIexamples-Creatinganissueusingcustomfields 5 | // Issue Links : https://docs.atlassian.com/jira/REST/server/?_ga=2.55654315.1871534859.1501779326-1034760119.1468908320#api/2/issueLink-linkIssues 6 | // Required Fields: https://jira.mypaytm.com/rest/api/2/issue/createmeta?projectKeys=MDO&expand=projects.issuetypes.fields& 7 | // Meta-data : http://localhost:8080/rest/api/2/issue/JRA-13/editmeta 8 | // 9 | 10 | var program = require('commander'); 11 | var config = require('../lib/config'); 12 | var auth = require('../lib/auth'); 13 | var ls = require('../lib/jira/ls'); 14 | var describe = require('../lib/jira/describe'); 15 | var assign = require('../lib/jira/assign'); 16 | var fix = require('../lib/jira/fix'); 17 | var release = require('../lib/jira/release'); 18 | var send = require('../lib/jira/send'); 19 | var comment = require('../lib/jira/comment'); 20 | var sprint = require('../lib/jira/sprint'); 21 | var transitions = require('../lib/jira/transitions'); 22 | var worklog = require('../lib/jira/worklog'); 23 | var link = require('../lib/jira/link'); 24 | var watch = require('../lib/jira/watch'); 25 | var addToSprint = require('../lib/jira/addToSprint'); 26 | var newCreate = require('../lib/jira/new'); 27 | var _set = require('lodash.set'); 28 | 29 | var edit = require('../lib/jira/edit'); 30 | 31 | const pkg = require('../package.json'); 32 | const CreateIssue = require('../lib/jira/create'); 33 | const JiraClient = require('jira-connector'); 34 | 35 | function finalCb(err) { 36 | if (err) { 37 | console.log(err.toString()); 38 | } 39 | 40 | process.exit(1); 41 | } 42 | 43 | // this code will ensure that in the event we're putting a large response to stdout (large json response for example) 44 | // that the process does not shutdown before stdout has finished processing the response 45 | // https://github.com/pnp/cli-microsoft365/issues/1266 46 | if (process.stdout._handle) { 47 | process.stdout._handle.setBlocking(true); 48 | } 49 | 50 | program.version(pkg.version); 51 | program 52 | .command('ls') 53 | .description('List my issues') 54 | .option('-p, --project ', 'Filter by project', String) 55 | .option('-t, --type ', 'Filter by type', String) 56 | .option('-v, --verbose', 'verbose output') 57 | .action(function(options) { 58 | if (options.project) { 59 | ls.showByProject(options, finalCb); 60 | } else { 61 | ls.showAll(options, finalCb); 62 | } 63 | }); 64 | program 65 | .command('start ') 66 | .description('Start working on an issue.') 67 | .action(function(issue) { 68 | transitions.start(issue, finalCb); 69 | }); 70 | program 71 | .command('stop ') 72 | .description('Stop working on an issue.') 73 | .action(function(issue) { 74 | transitions.stop(issue, finalCb); 75 | }); 76 | program 77 | .command('review [assignee]') 78 | .description('Mark issue as being reviewed [by assignee(optional)].') 79 | .action(function(issue, assignee) { 80 | transitions.review(issue, finalCb); 81 | 82 | if (assignee) { 83 | assign.to(issue, assignee, finalCb); 84 | } 85 | }); 86 | program 87 | .command('done ') 88 | .option('-r, --resolution ', 'resolution name (e.g. \'Resolved\')', String) 89 | .option('-t, --timeSpent