Skip to content

Auto create PBI is done #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions app/controllers/scrum_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,7 @@ def new_pbi
end

def create_pbi
begin
@continue = !(params[:create_and_continue].nil?)
@top = !(params[:top].nil?)
@pbi = Issue.new
@pbi.project = @project
@pbi.author = User.current
@pbi.tracker_id = params[:issue][:tracker_id]
update_attributes(@pbi, params)
if @top
@pbi.set_on_top
@pbi.save!
end
@pbi.sprint = @sprint
@pbi.save!
rescue Exception => @exception
logger.error("Exception: #{@exception.inspect}")
end
create_pbi_auto(params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 2 (not 1) spaces for indentation.

respond_to do |format|
format.js
end
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/sprints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def create
raise 'Fail to update project with product backlog' unless @project.save!
end
flash[:notice] = l(:notice_successful_create)
pbi_params = {"issue"=>{"tracker_id"=> Tracker.find_by_name('Product Backlog').id, "sprint_id"=> @sprint.id, "subject"=>"#{@sprint.name} pbi", "status_id"=> IssueStatus.find_by_name('In Progress').id , "priority_id"=> Enumeration.find_by_name('Normal').id, "assigned_to_id"=>"", "start_date"=>@sprint.sprint_start_date, "due_date"=>@sprint.sprint_end_date, "estimated_hours"=>"", "done_ratio"=>"0", "custom_field_values"=>{ "#{CustomField.find_by_name('Story Points').id}"=>"#{CustomField.find_by_name('Story Points').default_value}"}, "description"=>""}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. Separate each key value pair in new line

create_pbi_auto(pbi_params)
redirect_back_or_default settings_project_path(@project, :tab => 'sprints')
else
render :action => :new
Expand Down