-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path_jira
1223 lines (1160 loc) · 47.3 KB
/
_jira
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#compdef jira
# -----------------------------------------------------------------------------
# The BSD-3-Clause License
#
# Copyright (c) 2017, Koichi Shiraishi
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of que nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# github.com/Netflix-Skunkworks/go-jira/cmd/jira
#
# usage: jira [<flags>] <command> [<args> ...]
#
# Jira Command Line Interface
#
# Flags:
# --help Show context-sensitive help (also try --help-long
# and --help-man).
# -v, --verbose ... Increase verbosity for debugging
# -e, --endpoint=ENDPOINT Base URI to use for Jira
# -k, --insecure Disable TLS certificate verification
# -Q, --quiet Suppress output to console
# --unixproxy=UNIXPROXY Path for a unix-socket proxy
# --socksproxy=SOCKSPROXY Address for a socks proxy
# -u, --user=USER Login name used for authentication with Jira
# service
#
# Commands:
# help [<command>...]
# Show help.
#
#
# version
# Prints version
#
#
# acknowledge [<flags>] <ISSUE>
# Transition issue to acknowledge state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# assign [<flags>] <ISSUE> [<ASSIGNEE>]
# Assign user to issue
#
# -b, --browse Open issue(s) in browser after operation
# --default use default user for assignee
#
# attach create [<flags>] <ISSUE> [<ATTACHMENT>]
# Attach file to issue
#
# -b, --browse Open issue(s) in browser after operation
# --saveFile=SAVEFILE Write attachment information as yaml to file
# -f, --filename=FILENAME Filename to use for attachment
#
# attach get [<flags>] [<ATTACHMENT-ID>]
# Fetch attachment
#
# -o, --output=OUTPUT Write attachment to specified file name, '-' for stdout
#
# attach list [<flags>] <ISSUE>
# Prints attachment details for issue
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
#
# attach remove [<ATTACHMENT-ID>]
# Delete attachment
#
#
# backlog [<flags>] <ISSUE>
# Transition issue to Backlog state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# block [<flags>] <BLOCKER> <ISSUE>
# Mark issues as blocker
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# -m, --comment=COMMENT Comment message when marking issue as blocker
#
# browse <ISSUE>
# Open issue in browser
#
#
# close [<flags>] <ISSUE>
# Transition issue to close state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# comment [<flags>] [<ISSUE>]
# Add comment to issue
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
#
# component add [<flags>]
# Add component
#
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -p, --project=PROJECT project to create component in
# -n, --name=NAME name of component
# -d, --description=DESCRIPTION description of component
# -l, --lead=LEAD person that acts as lead for component
#
# components [<flags>]
# Show components for a project
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
# -p, --project=PROJECT project to list components
#
# create [<flags>]
# Create issue
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -p, --project=PROJECT project to create issue in
# -i, --issuetype=ISSUETYPE issuetype in to create
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --saveFile=SAVEFILE Write issue as yaml to file
#
# createmeta [<flags>]
# View 'create' metadata
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
# -p, --project=PROJECT project to fetch create metadata
# -i, --issuetype=ISSUETYPE issuetype in project to fetch create metadata
#
# done [<flags>] <ISSUE>
# Transition issue to Done state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# dup [<flags>] <DUPLICATE> <ISSUE>
# Mark issues as duplicate
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# -m, --comment=COMMENT Comment message when marking issue as duplicate
#
# edit [<flags>] [<ISSUE>]
# Edit issue details
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -n, --named-query=NAMED-QUERY The name of a query in the `queries`
# configuration
# -q, --query=QUERY Jira Query Language (JQL) expression for the
# search to edit multiple issues
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
#
# editmeta [<flags>] <ISSUE>
# View 'edit' metadata
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
#
# epic add <EPIC> <ISSUE>...
# Add issues to Epic
#
#
# epic create [<flags>]
# Create Epic
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -p, --project=PROJECT project to create epic in
# -n, --epic-name=EPIC-NAME Epic Name
# -m, --comment=COMMENT Comment message for epic
# -o, --override=OVERRIDE ... Set epic property
# --saveFile=SAVEFILE Write epic as yaml to file
#
# epic list [<flags>] <EPIC>
# Prints list of issues for an epic with optional search criteria
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
# -a, --assignee=ASSIGNEE User assigned the issue
# -c, --component=COMPONENT Component to search for
# -i, --issuetype=ISSUETYPE Issue type to search for
# -l, --limit=LIMIT Maximum number of results to return in search
# -p, --project=PROJECT Project to search for
# -n, --named-query=NAMED-QUERY The name of a query in the `queries`
# configuration
# -q, --query=QUERY Jira Query Language (JQL) expression for the
# search
# -f, --queryfields=QUERYFIELDS Fields that are used in "list" template
# -r, --reporter=REPORTER Reporter to search for
# -S, --status=STATUS Filter on issue status
# -s, --sort=SORT Sort order to return
# -w, --watcher=WATCHER Watcher to search for
#
# epic remove <ISSUE>...
# Remove issues from Epic
#
#
# export-templates [<flags>]
# Export templates for customizations
#
# -t, --template=TEMPLATE Template to export
# -d, --dir=DIR directory to write tempates to
#
# fields [<flags>]
# Prints all fields, both System and Custom
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
#
# in-progress [<flags>] <ISSUE>
# Transition issue to Progress state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# issuelink [<flags>] <OUTWARDISSUE> <ISSUELINKTYPE> <INWARDISSUE>
# Link two issues
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# -m, --comment=COMMENT Comment message when linking issue
#
# issuelinktypes [<flags>]
# Show the issue link types
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
#
# issuetypes [<flags>]
# Show issue types for a project
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
# -p, --project=PROJECT project to list issueTypes
#
# labels add [<flags>] <ISSUE> <LABEL>...
# Add labels to an issue
#
# -b, --browse Open issue(s) in browser after operation
#
# labels remove [<flags>] <ISSUE> <LABEL>...
# Remove labels from an issue
#
# -b, --browse Open issue(s) in browser after operation
#
# labels set [<flags>] <ISSUE> <LABEL>...
# Set labels on an issue
#
# -b, --browse Open issue(s) in browser after operation
#
# list [<flags>]
# Prints list of issues for given search criteria
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
# -a, --assignee=ASSIGNEE User assigned the issue
# -c, --component=COMPONENT Component to search for
# -i, --issuetype=ISSUETYPE Issue type to search for
# -l, --limit=LIMIT Maximum number of results to return in search
# -p, --project=PROJECT Project to search for
# -n, --named-query=NAMED-QUERY The name of a query in the `queries`
# configuration
# -q, --query=QUERY Jira Query Language (JQL) expression for the
# search
# -f, --queryfields=QUERYFIELDS Fields that are used in "list" template
# -r, --reporter=REPORTER Reporter to search for
# -S, --status=STATUS Filter on issue status
# -s, --sort=SORT Sort order to return
# -w, --watcher=WATCHER Watcher to search for
#
# login
# Attempt to login into jira server
#
#
# logout
# Deactivate session with Jira server
#
#
# rank [<flags>] <FIRST-ISSUE> <after|before> <SECOND-ISSUE>
# Mark issues as blocker
#
# -b, --browse Open issue(s) in browser after operation
#
# reopen [<flags>] <ISSUE>
# Transition issue to reopen state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# request [<flags>] <API> [<JSON>]
# Open issue in requestr
#
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
# -M, --method=METHOD HTTP request method to use
#
# resolve [<flags>] <ISSUE>
# Transition issue to resolve state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# start [<flags>] <ISSUE>
# Transition issue to start state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# stop [<flags>] <ISSUE>
# Transition issue to stop state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# subtask [<flags>] [<ISSUE>]
# Subtask issue
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -p, --project=PROJECT project to subtask issue in
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
#
# take [<flags>] <ISSUE> [<ASSIGNEE>]
# Assign issue to yourself
#
# -b, --browse Open issue(s) in browser after operation
# --default use default user for assignee
#
# todo [<flags>] <ISSUE>
# Transition issue to To Do state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# transition [<flags>] <TRANSITION> <ISSUE>
# Transition issue to given state
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for issue
# -o, --override=OVERRIDE ... Set issue property
# --resolution=RESOLUTION Set resolution on transition
#
# transitions [<flags>] <ISSUE>
# List valid issue transitions
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
#
# transmeta [<flags>] <ISSUE>
# List valid issue transitions
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
#
# unassign [<flags>] <ISSUE> [<ASSIGNEE>]
# Unassign an issue
#
# -b, --browse Open issue(s) in browser after operation
# --default use default user for assignee
#
# unexport-templates [<flags>]
# Remove unmodified exported templates
#
# -t, --template=TEMPLATE Template to export
# -d, --dir=DIR directory to write tempates to
#
# view [<flags>] <ISSUE>
# Prints issue details
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
# --expand=EXPAND ... field to expand for the issue
# --field=FIELD ... field to return for the issue
# --property=PROPERTY ... property to return for issue
#
# vote [<flags>] [<ISSUE>]
# Vote up/down an issue
#
# -b, --browse Open issue(s) in browser after operation
# -d, --down downvote the issue
#
# watch [<flags>] <ISSUE> [<WATCHER>]
# Add/Remove watcher to issue
#
# -b, --browse Open issue(s) in browser after operation
# -r, --remove remove watcher from issue
#
# worklog add [<flags>] <ISSUE>
# Add a worklog to an issue
#
# -b, --browse Open issue(s) in browser after operation
# --editor=EDITOR Editor to use
# -t, --template=TEMPLATE Template to use for output
# --noedit Disable opening the editor
# -m, --comment=COMMENT Comment message for worklog
# -T, --time-spent=TIME-SPENT Time spent working on issue
# -S, --started=STARTED Time you started work
#
# worklog list [<flags>] <ISSUE>
# Prints the worklog data for given issue
#
# -b, --browse Open issue(s) in browser after operation
# -t, --template=TEMPLATE Template to use for output
# --gjq=GJQ GJSON Query to filter output, see
# https://goo.gl/iaYwJ5
#
# -----------------------------------------------------------------------------
function _jira() {
local context curcontext=$curcontext state line ret=1
declare -A opt_args
local -a commands global_flags
commands=(
'help:Show help'
'version:Prints version'
'acknowledge:Transition issue to acknowledge state'
'assign:Assign user to issue'
'attach:Manage attachment'
'backlog:Transition issue to Backlog state'
'block:Mark issues as blocker'
'browse:Open issue in browser'
'close:Transition issue to close state'
'comment:Add comment to issue'
'component:Manage component'
'components:Show components for a project'
'create:Create issue'
"createmeta:View 'create' metadata"
'done:Transition issue to Done state'
'dup:Mark issues as duplicate'
'edit:Edit issue details'
"editmeta:View 'edit' metadata"
'epic:Manage Epic'
'export-templates:Export templates for customizations'
'fields:Prints all fields, both System and Custom'
'in-progress:Transition issue to Progress state'
'issuelink:Link two issues'
'issuelinktypes:Show the issue link types'
'issuetypes:Show issue types for a project'
'labels:Manage labels'
'list:Prints list of issues for given search criteria'
'login:Attempt to login into jira server'
'logout:Deactivate session with Jira server'
'rank:Mark issues as blocker'
'reopen:Transition issue to reopen state'
'request:Open issue in requestr'
'resolve:Transition issue to resolve state'
'start:Transition issue to start state'
'stop:Transition issue to stop state'
'subtask:Subtask issue'
'take:Assign issue to yourself'
'todo:Transition issue to To Do state'
'transition:Transition issue to given state'
'transitions:List valid issue transitions'
'transmeta:List valid issue transitions'
'unassign:Unassign an issue'
'unexport-templates:Remove unmodified exported templates'
'view:Prints issue details'
'vote:Vote up/down an issue'
'watch:Add/Remove watcher to issue'
'worklog:Manage worklog'
)
global_flags=(
'--help:Show context-sensitive help'
'--help-long:Show long help'
'--help-man:Show man page style help'
{-v,--verbose}':Increase verbosity for debugging'
{-e,--endpoint}':Base URI to use for Jira:ENDPOINT'
{-k,--insecure}':Disable TLS certificate verification'
{-Q,--quiet}':Suppress output to console'
'--unixproxy:Path for a unix-socket proxy:UNIXPROXY'
'--socksproxy:Address for a socks proxy:SOCKSPROXY'
{-u,--user}':Login name used for authentication with Jira service:USER'
)
_templates() {
_values \
'template' \
'attach-list' \
'comment' \
'component-add' \
'components' \
'create' \
'createmeta' \
'debug' \
'edit' \
'editmeta' \
'epic-create' \
'epic-list' \
'fields' \
'issuelinktypes' \
'issuetypes' \
'json' \
'list' \
'request' \
'subtask' \
'table' \
'transition' \
'transitions' \
'transmeta' \
'view' \
'worklog' \
'worklogs'
}
_arguments \
"1: :{_describe 'jira command' commands}" \
'*:: :->args' \
&& ret=0
case $state in
(args)
case $words[1] in
(help,version,login,logout)
;;
acknowledge)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-m,--comment=}'[Comment message for issue]:COMMENT' \
{-o,--override=}'[...Set issue property]:OVERRIDE' \
'--resolution=[Set resolution on transition]:RESOLUTION' \
'*:<ISSUE>'
;;
assign)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--default[use default user for assignee]' \
'*:<ISSUE>' \
'2:[<ASSIGNEE>]'
;;
attach)
local -a attach_cmds
attach_cmds=(
'create:Attach file to issue'
'get:Fetch attachment'
'list:Prints attachment details for issue'
'remove:Delete attachment'
)
_arguments \
": :{_describe 'global flags' global_flags}" \
"1: :{_describe 'attach subcommand' attach_cmds}" \
'*:: :->args'
case $words[1] in
create)
_arguments \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--saveFile=[Write attachment information as yaml to file]:SAVEFILE' \
{-f,--filename=}'[Filename to use for attachment]:FILENAME' \
'*:<ISSUE>' \
'2:[<ASSIGNEE>]'
;;
get)
_arguments \
{-o,--output=}'[Write attachment to specified file name, '-' for stdout]:OUTPUT' \
'*:[<ATTACHMENT-ID>]'
;;
list)
_arguments \
{-b,--browse}'[Open issue(s) in browser after operation]' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'*:<ISSUE>'
;;
remove)
_arguments \
'*:[<ATTACHMENT-ID>]'
;;
esac
;;
backlog)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--noedit[Disable opening the editor]' \
{-o,--override=}'[Set issue property]:OVERRIDE' \
'--resolution=[Set resolution on transition]:RESOLUTION' \
'*:<ISSUE>'
;;
block)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
{-m,--comment=}'[Comment message when marking issue as blocker]:COMMENT' \
'*:<BLOCKER>' \
'2:<ISSUE>'
;;
browse)
_arguments \
": :{_describe 'global flags' global_flags}" \
'*:<ISSUE>'
;;
close)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-m,--comment=}'[Comment message for issue]:COMMENT' \
{-o,--override=}'[Set issue property]:OVERRIDE' \
'--resolution=[Set resolution on transition]:RESOLUTION' \
'*:<ISSUE>'
;;
comment)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-m,--comment=}'[Comment message for issue]:COMMENT' \
'*:<ISSUE>'
;;
component)
local -a component_cmds
component_cmds=(
'add:Add component'
)
_arguments \
": :{_describe 'global flags' global_flags}" \
"1: :{_describe 'component subcommand' component_cmds}" \
'*:: :->args'
case $words[1] in
add)
_arguments \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-p,--project=}'[project to create component in]:PROJECT' \
{-n,--name=}'[name of component]:NAME' \
{-d,--description=}'[description of component]:DESCRIPTION' \
{-l,--lead=}'[person that acts as lead for component]:LEAD'
;;
esac
;;
components)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--gjq=[GJSON Query to filter output, see https://goo.gl/iaYwJ5]:GJQ' \
{-p,--project=}'[project to create component in]:PROJECT'
;;
create)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-p,--project=}'[project to create component in]:PROJECT' \
{-i,--issuetype=}'[issuetype in to create]:ISSUETYPE' \
{-m,--comment=}'[Comment message for issue]:COMMENT' \
{-o,--override=}'[Set issue property]:OVERRIDE' \
'--saveFile=[Write issue as yaml to file]:SAVEFILE'
;;
createmeta)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--gjq=[GJSON Query to filter output, see https://goo.gl/iaYwJ5]:GJQ' \
{-p,--project=}'[project to create component in]:PROJECT' \
{-i,--issuetype=}'[issuetype in to create]:ISSUETYPE'
;;
done)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-m,--comment=}'[Comment message for issue]:COMMENT' \
{-o,--override=}'[Set issue property]:OVERRIDE' \
'--resolution=[Set resolution on transition]:RESOLUTION' \
'*:<ISSUE>'
;;
dup)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
{-m,--comment=}'[Comment message when marking issue as duplicate]:COMMENT' \
'*:<DUPLICATE>' \
'2:<ISSUE>'
;;
edit)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-n,--named-query=}'[The name of a query in the `queries` configuration]:NAMED-QUERY' \
{-q,--query=}'[Jira Query Language (JQL) expression for the search]:QUERY' \
{-m,--comment=}'[Comment message when marking issue as duplicate]:COMMENT' \
{-o,--override=}'[Set issue property]:OVERRIDE' \
'*:<ISSUE>'
;;
editmeta)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--gjq=[GJSON Query to filter output, see https://goo.gl/iaYwJ5]:GJQ' \
'*:<ISSUE>'
;;
epic)
local -a epic_cmds
epic_cmds=(
'add:Add issues to Epic'
'create:Create Epic'
'list:Prints list of issues for an epic with optional search criteria'
'remove:Remove issues from Epic'
)
_arguments \
": :{_describe 'global flags' global_flags}" \
"1: :{_describe 'epic subcommand' epic_cmds}" \
'*:: :->args'
case $words[1] in
add)
_arguments \
'*:<EPIC>' \
'*:<ISSUE>'
;;
create)
_arguments \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-p,--project=}'[project to create epic in]:PROJECT' \
{-n,--epic-name=}'[Epic Name]:EPIC-NAME' \
{-m,--comment=}'[Comment message for epic]:COMMENT' \
{-o,--override=}'[Set epic property]:OVERRIDE' \
'--saveFile=[Write epic as yaml to file]:SAVEFILE'
;;
list)
_arguments \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--gjq=[GJSON Query to filter output, see https://goo.gl/iaYwJ5]:GJQ' \
{-a,--assignee=}'[User assigned the issue]:ASSIGNEE' \
{-c,--component=}'[Component to search for]:COMPONENT' \
{-i,--issuetype=}'[issuetype in to create]:ISSUETYPE' \
{-l, --limit=}'[Maximum number of results to return in search]:LIMIT' \
{-p,--project=}'[project to create epic in]:PROJECT' \
{-n,--named-query=}'[The name of a query in the `queries` configuration]:NAMED-QUERY' \
{-q,--query=}'[Jira Query Language (JQL) expression for the search]:QUERY' \
{-f,--queryfields=}'[Fields that are used in "list" template]:QUERYFIELDS' \
{-r,--reporter=}'[Reporter to search for]:REPORTER' \
{-S,--status=}'[Filter on issue status]:STATUS' \
{-s,--sort=}'[Sort order to return]:SORT' \
{-w,--watcher=}'[Watcher to search for]:WATCHER' \
'*:<EPIC>'
;;
remove)
_arguments \
'*:<ISSUE>'
;;
esac
;;
export-templates)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-t,--template=}'[Template to export]:TEMPLATE' \
{-d,--dir=}'[directory to write tempates to]:DIR'
;;
fields)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--gjq=[GJSON Query to filter output, see https://goo.gl/iaYwJ5]:GJQ'
;;
in-progress)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--noedit[Disable opening the editor]' \
{-m,--comment=}'[Comment message for issue]:COMMENT' \
{-o,--override=}'[Set issue property]:OVERRIDE' \
'--resolution=[Set resolution on transition]:RESOLUTION' \
'*:<ISSUE>'
;;
issuelink)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'--editor=[Editor to use]:EDITOR' \
{-t,--template=}'[Template to export]:TEMPLATE' \
{-m,--comment=}'[Comment message when linking issue]:COMMENT' \
'*:<OUTWARDISSUE>' \
'2:<ISSUELINKTYPE>' \
'3:<INWARDISSUE>'
;;
issuelinktypes)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-t,--template=}'[Template to export]:TEMPLATE' \
'--gjq=[GJSON Query to filter output, see https://goo.gl/iaYwJ5]:GJQ'
;;
issuetypes)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-t,--template=}'[Template to export]:TEMPLATE' \
'--gjq=[GJSON Query to filter output, see https://goo.gl/iaYwJ5]:GJQ' \
{-p,--project=}'[project to list issueTypes]:PROJECT'
;;
labels)
local -a labels_cmds
labels_cmds=(
'add:Add labels to an issue'
'remove:Remove labels from an issue'
'set:Set labels on an issue'
)
_arguments \
": :{_describe 'global flags' global_flags}" \
"1: :{_describe 'labels subcommand' labels_cmds}" \
'*:: :->args'
case $words[1] in
add)
_arguments \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'*:<ISSUE>' \
'*:<LABEL>'
;;
remove)
_arguments \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'*:<ISSUE>' \
'*:<LABEL>'
;;
set)
_arguments \
{-b,--browse}'[Open issue(s) in browser after operation]' \
'*:<ISSUE>' \
'*:<LABEL>'
;;
esac
;;
list)
_arguments \
": :{_describe 'global flags' global_flags}" \
{-t,--template=}'[Template to use for output]:TEMPLATE' \
'--gjq=[GJSON Query to filter output]:GJQ' \
{-a,--assignee=}"[User assigned the issue]:ASSIGNEE:($(id -u -n))" \
{-c,--component=}'[Component to search for]:COMPONENT' \
{-i,--issuetype=}'[Issue type to search for]:ISSUETYPE' \
{-l,--limit=}'[Maximum number of results to return in search]:LIMIT' \
{-p,--project=}'[Project to search for]:PROJECT' \
{-n,--named-query=}'[The name of a query in the `queries` configuration]:NAMED-QUERY' \
{-q,--query=}'[Jira Query Language (JQL) expression for the search]:QUERY' \
{-f,--queryfields=}'[Fields that are used in "list" template]:QUERYFIELDS' \
{-r,--reporter=}'[Reporter to search for]:REPORTER' \
{-S,--status=}'[Filter on issue status]:STATUS' \
{-s,--sort=}'[Sort order to return]:SORT' \