jira_tracker 0.0.3 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29f06d8bdf84c158f7c7c777ef3fd3b29893b333
4
- data.tar.gz: f4132258060bd58704313af7790869f31de92006
3
+ metadata.gz: f3216485be80c6f055b876596ab914b2b898752c
4
+ data.tar.gz: ef6b947d0cef4bfe66405bcf8a6c49e306843043
5
5
  SHA512:
6
- metadata.gz: f0320603397cc0546011ef0ab8773f91342f99999d205fff400aff3d8a38bda42db08d2679f269a33704f05f94248be901af6dfedbf8c8a885c34f9875f7e4d3
7
- data.tar.gz: 4f8db30ba937c38dda80648608f5fb52d3f95f3a495f07ba6cc56877a8363660744da0578d59fc6a0309e9eb6a21111bbce31ff3aa50c19b578189d5324f1ae7
6
+ metadata.gz: bc52283e1bd7d4208b07059085b4d83ee3ffcb694503b23ec449ef73574e0d0f0fad71b19efbe19dec787ef8c17a703f84f9149aa2a9e9c0c51a7649f91a5cf2
7
+ data.tar.gz: 04abc1c743d3276315cbb1923768e0387c2d03a8bd01b595929488b887b8a998099e4da899d2d523cef8aea99f4897f6a724fed9e96949da2522260de4a12374
data/README.md CHANGED
@@ -13,19 +13,19 @@ jira_tracker initialize
13
13
  ## Usage
14
14
 
15
15
  ```
16
- jira_tracker <ticket/project> <time-spent>
16
+ jira_tracker <ticket/project> <time-spent> "<comment>"
17
17
  ```
18
18
 
19
19
  When you work on specific ticket
20
20
 
21
21
  ```
22
- jira_tracker xoya-10 1h
22
+ jira_tracker xoya-10 1h "test comment"
23
23
  ```
24
24
 
25
25
  When you don't have any ticket but you work on a project
26
26
 
27
27
  ```
28
- jira_tracker xoya 1h
28
+ jira_tracker xoya 1h "test comment"
29
29
  ```
30
30
 
31
31
 
@@ -34,3 +34,8 @@ otherwise will look for a project with ticket that has summary `Time Tracking Ti
34
34
 
35
35
  *You can specify a time unit after a time value 'X', such as Xw, Xd, Xh or Xm,
36
36
  to represent weeks (w), days (d), hours (h) and minutes (m), respectively.*
37
+
38
+
39
+ ## Developer docs for JIRA REST api
40
+
41
+ [Worklog POST request](https://docs.atlassian.com/jira/REST/latest/#idp2062512)
@@ -39,6 +39,7 @@ end
39
39
 
40
40
  issue = ARGV[0]
41
41
  time_spent = ARGV[1]
42
+ comment = ARGV[2]
42
43
 
43
44
  if issue.nil? or issue.length < 4
44
45
  p 'You forgot to specify issue/project or it is to short.'
@@ -50,4 +51,4 @@ if time_spent.nil? or time_spent.length < 2
50
51
  exit
51
52
  end
52
53
 
53
- JiraTracker.run(issue, time_spent)
54
+ JiraTracker.run(issue, time_spent, comment)
@@ -7,7 +7,7 @@ module JiraTracker
7
7
 
8
8
  @config = nil
9
9
 
10
- def self.run(issue, time_spent)
10
+ def self.run(issue, time_spent, comment)
11
11
  begin
12
12
  @config = YAML.load_file "#{Dir.home}/.jira_tracker.yml"
13
13
  rescue
@@ -16,19 +16,19 @@ module JiraTracker
16
16
  end
17
17
 
18
18
  options = {
19
- :username => @config['username'],
20
- :password => @config['password'],
21
- :site => @config['site'],
22
- :context_path => '',
23
- :rest_base_path => '/rest/api/2',
24
- :auth_type => :basic
19
+ :username => @config['username'],
20
+ :password => @config['password'],
21
+ :site => @config['site'],
22
+ :context_path => '',
23
+ :rest_base_path => '/rest/api/2',
24
+ :auth_type => :basic
25
25
  }
26
26
 
27
27
  client = JIRA::Client.new(options)
28
- JiraTracker.worklog(issue, time_spent, client)
28
+ JiraTracker.worklog(issue, time_spent, comment, client)
29
29
  end
30
30
 
31
- def self.worklog(issue, time_spent, client)
31
+ def self.worklog(issue, time_spent = '0m', comment = '', client)
32
32
  jira_issue = JiraTracker.find do
33
33
  if issue.include?('-')
34
34
  client.Issue.find(issue)
@@ -41,7 +41,7 @@ module JiraTracker
41
41
 
42
42
  worklog = jira_issue.worklogs.build
43
43
 
44
- worklog.save({'timeSpent' => time_spent})
44
+ worklog.save({'timeSpent' => time_spent, 'comment' => comment})
45
45
  p "Thanks! #{time_spent} was added to #{jira_issue.key} - #{jira_issue.summary}"
46
46
 
47
47
  unless worklog.issue.timespent.nil?
@@ -1,3 +1,3 @@
1
1
  module JiraTracker
2
- VERSION = '0.0.3'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jira_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - zigomir
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-06 00:00:00.000000000 Z
12
+ date: 2013-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jira-ruby
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.0.3
140
+ rubygems_version: 2.1.1
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Track time on Jira spent on individual issues