From 1728f5e1ef79c8c1ae04e0496cd3d8d3c5049b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20=C5=A0timac?= Date: Sun, 20 Dec 2015 14:01:49 +0100 Subject: [PATCH 1/3] Added an assignee parameter to isse_create method --- .gitignore | 1 + README.rst | 13 ++++++++++--- jiracli/__init__.py | 12 ++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f377ed9..97a09d6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ jiracli.egg-info/ build AUTHORS ChangeLog +.idea \ No newline at end of file diff --git a/README.rst b/README.rst index fe8fc5f..1297efe 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 ============= @@ -35,9 +40,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: @@ -163,3 +169,4 @@ The following command will show you the current ongoing sprint of a project:: RD-1547 In Progress user_owner Bug on main screen of MyLittlePoney Project RD-1517 Refused Nobody Please add a green poney RD-1516 Resolved user_x My poney is not pink enough + diff --git a/jiracli/__init__.py b/jiracli/__init__.py index dc35ef3..bc4e7c6 100755 --- a/jiracli/__init__.py +++ b/jiracli/__init__.py @@ -310,9 +310,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 ' @@ -571,6 +571,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(',') @@ -579,10 +580,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': 'gstimac'}) + issue_list_print(jira_obj, [new_issue], True, True, False, False) sys.exit(0) From c97122a024c2d1b1eb8877bfb427205926a5812a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20=C5=A0timac?= Date: Sun, 20 Dec 2015 14:09:51 +0100 Subject: [PATCH 2/3] Fixed assignee issue, added installed_files to ignorelist --- .gitignore | 3 ++- jiracli/__init__.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 97a09d6..6c00a0d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ jiracli.egg-info/ build AUTHORS ChangeLog -.idea \ No newline at end of file +.idea +installed_files.txt \ No newline at end of file diff --git a/jiracli/__init__.py b/jiracli/__init__.py index bc4e7c6..8501405 100755 --- a/jiracli/__init__.py +++ b/jiracli/__init__.py @@ -589,7 +589,7 @@ def main(): new_issue = jira_obj.create_issue(fields=issue_dict) if len(assignee) > 0: - new_issue.update(assignee={'name': 'gstimac'}) + new_issue.update(assignee={'name': assignee}) issue_list_print(jira_obj, [new_issue], True, True, False, False) sys.exit(0) From f706742b58c7465ffe8066583ee8580b29f28c9d Mon Sep 17 00:00:00 2001 From: goran Date: Wed, 29 Sep 2021 20:22:47 +0200 Subject: [PATCH 3/3] fixed newline at the end --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index 08ac4d5..0032d28 100644 --- a/README.rst +++ b/README.rst @@ -180,7 +180,6 @@ The following command will show you the current ongoing sprint of a project:: RD-1517 Refused Nobody Please add a green poney RD-1516 Resolved user_x My poney is not pink enough -======= Example: Assign an issue ------------------------ The following command will assign an issue to a given user::