jirack 0.1.2 → 0.2.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +15 -0
- data/lib/jirack/command.rb +29 -6
- data/lib/jirack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2bcac42459a795dec1c3d02d68bf2084f9858ff
|
4
|
+
data.tar.gz: 857462e79a8c78f02fdd0fabd55f743462869d93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0a15d071c942a28652032954146ad41adc8326c7088e741fd8ace12cfc98e62471cbdfe78597a3dc7de9ddf93a8f4a37385dfd7f296e094f4e5cc629588f0fa
|
7
|
+
data.tar.gz: 0d1226b89dcbb396774b768a3f8dd8730d457e5ea6cf62461b5143d0c9bc294232596d0bda0f4a19a9c951b7245de2ae44acb630c7d0a28d6b1f168724e3a5f6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -28,6 +28,10 @@ install it yourself as:
|
|
28
28
|
|
29
29
|
$ jirack list --sum-point
|
30
30
|
|
31
|
+
|
32
|
+
未割り当てのissueを確認する。
|
33
|
+
|
34
|
+
$ jirack list --unassign
|
31
35
|
|
32
36
|
チケットをステータスを前に進める。(ex. チケット9999を次のステータスにする)
|
33
37
|
`-m message`でslackにメッセージを通知する。
|
@@ -55,6 +59,17 @@ slackにメッセージだけを送る。(ex. チケット9999についてのメ
|
|
55
59
|
$ jirack open 9999
|
56
60
|
|
57
61
|
|
62
|
+
チケットを自分にアサインしたい
|
63
|
+
|
64
|
+
$ jirack assign 9999
|
65
|
+
|
66
|
+
|
67
|
+
分からなくなったら、
|
68
|
+
|
69
|
+
$ jirack help
|
70
|
+
$ jirack help list
|
71
|
+
|
72
|
+
|
58
73
|
## Development
|
59
74
|
|
60
75
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/jirack/command.rb
CHANGED
@@ -35,26 +35,32 @@ module Jirack
|
|
35
35
|
end
|
36
36
|
|
37
37
|
desc 'list', 'show your active issue'
|
38
|
-
method_option '
|
38
|
+
method_option 'unassign', type: :boolean, aliases: '-u', desc: 'show your all issue point'
|
39
|
+
method_option 'sum-point', type: :boolean, aliases: '-n', desc: 'show your all issue point'
|
39
40
|
def list
|
40
41
|
cred = Jirack::Credential.new
|
41
42
|
client = cred.jira_client
|
42
43
|
|
43
44
|
active_sprint = active_sprint(client, project_board(client, cred.project_name)['id'].to_i)
|
44
45
|
|
45
|
-
if options.key?('
|
46
|
-
|
46
|
+
if options.key?('unassign')
|
47
|
+
puts "#{ active_sprint['name'] } unassign issues: "
|
48
|
+
active_unassign_issue(client, cred.project_name, active_sprint['name']).each do |issue|
|
49
|
+
puts "#{ issue.key }: #{ issue.summary }(#{issue.id}) [#{ issue.points }] #{ issue.status.name } "
|
50
|
+
end
|
51
|
+
elsif options.key?('sum-point')
|
52
|
+
sum_points = active_assign_issue(client, cred.project_name, active_sprint['name']).inject(0.0) {|sum, issue| sum + issue.points }
|
47
53
|
puts "#{ active_sprint['name'] } points: #{ sum_points }"
|
48
54
|
else
|
49
55
|
puts "#{ active_sprint['name'] } issues: "
|
50
|
-
|
56
|
+
active_assign_issue(client, cred.project_name, active_sprint['name']).each do |issue|
|
51
57
|
puts "#{ issue.key }: #{ issue.summary }(#{issue.id}) [#{ issue.points }] #{ issue.status.name } "
|
52
58
|
end
|
53
59
|
end
|
54
60
|
end
|
55
61
|
|
56
62
|
desc 'forward issue_number', 'forward issue status'
|
57
|
-
method_option 'message', :
|
63
|
+
method_option 'message', aliases: '-m', desc: 'notify slack message'
|
58
64
|
def forward(issue_number)
|
59
65
|
cred = Jirack::Credential.new
|
60
66
|
client = cred.jira_client
|
@@ -126,6 +132,19 @@ module Jirack
|
|
126
132
|
issue = client.Issue.find("#{ cred.project_name }-#{ issue_number }")
|
127
133
|
|
128
134
|
Launchy.open issue_url(issue)
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
desc 'assign issue_number', 'assign issue to you'
|
139
|
+
def assign(issue_number)
|
140
|
+
cred = Jirack::Credential.new
|
141
|
+
client = cred.jira_client
|
142
|
+
|
143
|
+
issue = client.Issue.find("#{ cred.project_name }-#{ issue_number }")
|
144
|
+
|
145
|
+
myself = JIRA::Resource::UserFactory.new(client).myself
|
146
|
+
|
147
|
+
client.put("/rest/api/2/issue/#{ issue.key }/assignee", { name: myself.name }.to_json)
|
129
148
|
end
|
130
149
|
|
131
150
|
private
|
@@ -138,10 +157,14 @@ module Jirack
|
|
138
157
|
client.Agile.get_sprints(board_id, state: 'active')['values'].first
|
139
158
|
end
|
140
159
|
|
141
|
-
def
|
160
|
+
def active_assign_issue(client, project_name, sprint_name)
|
142
161
|
JIRA::Resource::Issue.jql(client, "project=\"#{ project_name }\" AND assignee = currentuser() AND cf[10007] = \"#{ sprint_name }\"")
|
143
162
|
end
|
144
163
|
|
164
|
+
def active_unassign_issue(client, project_name, sprint_name)
|
165
|
+
JIRA::Resource::Issue.jql(client, "project=\"#{ project_name }\" AND assignee = NULL AND cf[10007] = \"#{ sprint_name }\"")
|
166
|
+
end
|
167
|
+
|
145
168
|
def issue_url(issue)
|
146
169
|
uri = URI.parse(issue.self)
|
147
170
|
"https://#{ uri.host }/browse/#{ issue.key }"
|
data/lib/jirack/version.rb
CHANGED