Skip to content

Commit

Permalink
#393: support the custom field for sprint
Browse files Browse the repository at this point in the history
Fixed #393
  • Loading branch information
dgroup committed May 2, 2021
1 parent 1e438a9 commit 543821b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/lazylead/task/loading.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def to_s
"#{id} has #{total} tasks"
end

def sprints
@tasks.group_by(&:sprint).sort
def sprints(*label)
return @tasks.group_by(&:sprint).sort if label.empty? || label.nil?
@tasks.group_by { |t| t.sprint(label) }.sort
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/messages/loading.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<% if assignment.free? %>
<span style="color: red">0</span>
<% else %>
<% assignment.sprints.each do |s| %>
<% assignment.sprints(defined?(sprint) ? sprint : "customfield_10480").each do |s| %>
<a href="<%= search_link %><%= CGI.escape("#{jql} and assignee=#{teammate}") %>">
<%= s.first.blank? ? "No sprint" : s.first %>: <%= s.last.size %>
</a>
Expand Down
1 change: 1 addition & 0 deletions test/lazylead/task/loading_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LoadingTest < Lazylead::Test
"user_link" => "https://user.com?id=",
"search_link" => "https://jira.spring.io/issues/?jql=",
"fields" => "assignee,duedate,customfield_10480",
"sprint" => "customfield_10480",
"subject" => "[LL] Team loading",
"template" => "lib/messages/loading.erb"
)
Expand Down

0 comments on commit 543821b

Please sign in to comment.