diff --git a/.gitignore b/.gitignore index 48ad946..0060122 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ jiracli.egg-info/ build AUTHORS ChangeLog -.tox \ No newline at end of file +.idea +installed_files.txt +.tox diff --git a/README.rst b/README.rst index 41c0ec0..0032d28 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,12 @@ Installation * or directly from the extracted source:: - python setup.py install + python setup.py install --record installed_files.txt + +Uninstallation +============== + + * cat installed_files.txt | xargs rm -rf Configuration ============= @@ -45,9 +50,10 @@ Try the help with:: Example: create a new issue: ---------------------------- -The following command creates a new issue for the project PROJECT. Issue type is `Dev Bug`, labels are `abc` and `def` and components are `xxx` and `yyyy`:: +The following command creates a new issue for the project PROJECT. Issue type is `Dev Bug`, labels are `abc` and `def` and components are `xxx` and `yyyy`. +A new addition is the `assignee` field where you can directly assign an issue. - ./jiracli -c PROJECT "Dev Bug" "my test summary" "abc,def" "xxx,yyyy" + ./jiracli -c PROJECT "Dev Bug" "my test summary" "abc,def" "xxx,yyyy" "assignee" Example: show a single issue: diff --git a/jiracli/__init__.py b/jiracli/__init__.py index 4b4a32b..e9857bf 100755 --- a/jiracli/__init__.py +++ b/jiracli/__init__.py @@ -299,9 +299,9 @@ def parse_args(): help='disable colorful output (default: %(default)s)') group_issue = parser.add_argument_group('issue') # create - group_issue.add_argument('-c', '--issue-create', nargs=5, + group_issue.add_argument('-c', '--issue-create', nargs=6, metavar=('project-key', 'issue-type', - 'summary', 'labels', 'components'), + 'summary', 'labels', 'components', 'assignee'), help='create a new issue. "labels" can be a ' 'single label or a comma seperated list of ' 'labels. "components" can be a comma seperated ' @@ -600,6 +600,7 @@ def main(): 'summary': args['issue_create'][2], 'description': desc, } + assignee = ''; if len(args['issue_create'][3]) > 0: issue_dict['labels'] = args['issue_create'][3].split(',') @@ -608,10 +609,17 @@ def main(): issue_dict['components'] = [ {'name': c} for c in args['issue_create'][4].split(',')] + if len(args['issue_create'][5]) > 0: + assignee = args['issue_create'][5] + if args['issue_parent']: issue_dict['parent'] = {'id': args['issue_parent']} new_issue = jira_obj.create_issue(fields=issue_dict) + + if len(assignee) > 0: + new_issue.update(assignee={'name': assignee}) + issue_list_print(jira_obj, [new_issue], True, True, False, False) sys.exit(0)