atlassian-cli 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {atlassian_cli-0.6.0/src/atlassian_cli.egg-info → atlassian_cli-0.7.0}/PKG-INFO +1 -1
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/pyproject.toml +1 -1
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/jira.py +2 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/jira_issues.py +36 -28
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0/src/atlassian_cli.egg-info}/PKG-INFO +1 -1
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/LICENSE +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/README.md +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/setup.cfg +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/__init__.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/adf.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/config.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/confluence.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/hints.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/http.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/jira_assets.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/output.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli/update_check.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli.egg-info/SOURCES.txt +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli.egg-info/dependency_links.txt +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli.egg-info/entry_points.txt +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli.egg-info/requires.txt +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/src/atlassian_cli.egg-info/top_level.txt +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/tests/test_adf.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/tests/test_config.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/tests/test_confluence.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/tests/test_http.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/tests/test_jira_assets.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/tests/test_jira_issues.py +0 -0
- {atlassian_cli-0.6.0 → atlassian_cli-0.7.0}/tests/test_output.py +0 -0
|
@@ -48,6 +48,8 @@ def main():
|
|
|
48
48
|
p.add_argument('--labels', nargs='*', help='Labels')
|
|
49
49
|
p.add_argument('--assignee', help='Assignee account ID')
|
|
50
50
|
p.add_argument('--parent', help='Parent issue key (for sub-tasks)')
|
|
51
|
+
p.add_argument('--fields', help='JSON string of additional fields '
|
|
52
|
+
'(e.g. components, custom fields, ADF description)')
|
|
51
53
|
p.set_defaults(func=jira_issues.cmd_create)
|
|
52
54
|
|
|
53
55
|
p = issue_sub.add_parser('update', help='Update issue fields')
|
|
@@ -34,6 +34,12 @@ def _text_adf(text):
|
|
|
34
34
|
def cmd_get(args):
|
|
35
35
|
session, base = setup()
|
|
36
36
|
data = api_get(session, base, f'{V3}/issue/{args.key}')
|
|
37
|
+
if is_json_mode():
|
|
38
|
+
# preserve the full API response so callers can read components,
|
|
39
|
+
# custom fields, finding type, etc.
|
|
40
|
+
emit_json(data)
|
|
41
|
+
return
|
|
42
|
+
|
|
37
43
|
fields = data.get('fields', {})
|
|
38
44
|
key = data['key']
|
|
39
45
|
status = fields.get('status', {}).get('name', '?')
|
|
@@ -47,24 +53,14 @@ def cmd_get(args):
|
|
|
47
53
|
updated = fields.get('updated', '')[:10]
|
|
48
54
|
description = fields.get('description')
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
'
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
emit_json(json_data)
|
|
59
|
-
else:
|
|
60
|
-
print(f'{key} [{status}] {summary}')
|
|
61
|
-
print(f' Type: {issue_type} Priority: {priority} Assignee: {assignee_name}')
|
|
62
|
-
if labels:
|
|
63
|
-
print(f' Labels: {", ".join(labels)}')
|
|
64
|
-
print(f' Created: {created} Updated: {updated}')
|
|
65
|
-
if description:
|
|
66
|
-
print()
|
|
67
|
-
print(adf_to_markdown(description))
|
|
56
|
+
print(f'{key} [{status}] {summary}')
|
|
57
|
+
print(f' Type: {issue_type} Priority: {priority} Assignee: {assignee_name}')
|
|
58
|
+
if labels:
|
|
59
|
+
print(f' Labels: {", ".join(labels)}')
|
|
60
|
+
print(f' Created: {created} Updated: {updated}')
|
|
61
|
+
if description:
|
|
62
|
+
print()
|
|
63
|
+
print(adf_to_markdown(description))
|
|
68
64
|
|
|
69
65
|
|
|
70
66
|
def cmd_create(args):
|
|
@@ -82,6 +78,10 @@ def cmd_create(args):
|
|
|
82
78
|
fields['assignee'] = {'accountId': args.assignee}
|
|
83
79
|
if args.parent:
|
|
84
80
|
fields['parent'] = {'key': args.parent}
|
|
81
|
+
if getattr(args, 'fields', None):
|
|
82
|
+
# extra fields override the convenience flags above; useful for
|
|
83
|
+
# components, finding-type custom fields, full-ADF descriptions, etc.
|
|
84
|
+
fields.update(json.loads(args.fields))
|
|
85
85
|
|
|
86
86
|
result = api_post(session, base, f'{V3}/issue', {'fields': fields})
|
|
87
87
|
emit('OK', f'Created {result["key"]}', data=result)
|
|
@@ -146,7 +146,13 @@ def _search_page(session, base, jql, max_results, fields, next_page_token=None):
|
|
|
146
146
|
|
|
147
147
|
def cmd_search(args):
|
|
148
148
|
session, base = setup()
|
|
149
|
-
|
|
149
|
+
# In JSON mode, default to '*all' so callers see components and custom
|
|
150
|
+
# fields. The user can still narrow via an explicit --fields.
|
|
151
|
+
user_explicit_fields = args.fields != 'summary,status,assignee,issuetype'
|
|
152
|
+
if is_json_mode() and not user_explicit_fields:
|
|
153
|
+
fields = ['*all']
|
|
154
|
+
else:
|
|
155
|
+
fields = args.fields.split(',')
|
|
150
156
|
all_issues = []
|
|
151
157
|
token = None
|
|
152
158
|
|
|
@@ -162,19 +168,21 @@ def cmd_search(args):
|
|
|
162
168
|
if not args.all and len(all_issues) >= args.max:
|
|
163
169
|
break
|
|
164
170
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
if not is_json_mode():
|
|
172
|
+
for issue in all_issues:
|
|
173
|
+
f = issue.get('fields', {})
|
|
174
|
+
status = f.get('status', {}).get('name', '?')
|
|
175
|
+
summary = f.get('summary', '')
|
|
176
|
+
assignee = f.get('assignee', {})
|
|
177
|
+
assignee_name = assignee.get('displayName', '') if assignee else ''
|
|
178
|
+
extra = f' ({assignee_name})' if assignee_name else ''
|
|
179
|
+
print(f'{issue["key"]} [{status}] {summary}{extra}')
|
|
173
180
|
|
|
174
181
|
if args.dump:
|
|
175
182
|
with open(args.dump, 'w') as fh:
|
|
176
183
|
json.dump({'total': len(all_issues), 'issues': all_issues}, fh, indent=2)
|
|
177
|
-
|
|
184
|
+
if not is_json_mode():
|
|
185
|
+
print(f'Saved {len(all_issues)} issues to {args.dump}')
|
|
178
186
|
|
|
179
187
|
emit('DONE', f'{len(all_issues)} issues found',
|
|
180
188
|
data={'total': len(all_issues), 'issues': all_issues})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|