Module: UtilJira
- Defined in:
- lib/cloudmunch_sdk/UtilJira.rb
Class Method Summary collapse
- .getActiveSprint(server, endpoint, params) ⇒ Object
- .getSortedSprints(server, endpoint, params) ⇒ Object
Class Method Details
.getActiveSprint(server, endpoint, params) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cloudmunch_sdk/UtilJira.rb', line 35 def UtilJira.getActiveSprint(server, endpoint, params) sprints = [] newParam = { :action => "listcustomcontext", :fields => "sprint_id,sprint_status", :sort_by => "sprint_status", :count => "*", } newParam = params.merge(newParam) cqlQuery = CloudmunchService.getDataContext(server, endpoint, newParam) cqlQuery = JSON.parse(cqlQuery) sprint = nil cqlQuery.each do |x| if(x['sprint_status'] == 'ACTIVE') sprint = x['sprint_id'] end end return sprint end |
.getSortedSprints(server, endpoint, params) ⇒ Object
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 |
# File 'lib/cloudmunch_sdk/UtilJira.rb', line 7 def UtilJira.getSortedSprints(server, endpoint, params) sprints = [] sname_by_sequence = {} tseq = [] newParam = { :action => 'listcustomcontext', :fields => 'sequence, sprint_id', :group_by => 'sequence', :count => '*' } newParam = params.merge(newParam) cqlQuery = CloudmunchService.getDataContext(server, endpoint, newParam) cqlQuery = JSON.parse(cqlQuery) cqlQuery.each do |v| # puts v[1] tseq << v[1]['sequence'].to_i sname_by_sequence[v[1]['sequence'].to_i] = v[1]['sprint_id'] end tseq.sort!.each do |y| sprints << sname_by_sequence[y] end return sprints end |