Skip to content

Auto create PBI is done#1

Open
ravi-bhatt-btc wants to merge 5 commits intomasterfrom
Auto_create_PBI
Open

Auto create PBI is done#1
ravi-bhatt-btc wants to merge 5 commits intomasterfrom
Auto_create_PBI

Conversation

@ravi-bhatt-btc
Copy link
Contributor

Changes made to creat PBI after Creating sprint.

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

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,

Choose a reason for hiding this comment

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

Remove trailing whitespace

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,

Choose a reason for hiding this comment

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

Space inside { missing.

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,

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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,

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

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,

Choose a reason for hiding this comment

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

Line is too long. [89/80]

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,

Choose a reason for hiding this comment

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

Trailing whitespace detected.

"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}"},

Choose a reason for hiding this comment

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

Calls 'customfield.find_by_name('story points')' 2 times (DuplicateMethodCall)

"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}"},

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

"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}"},

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

"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}"},

Choose a reason for hiding this comment

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

Prefer to_s over string interpolation.

"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}"},

Choose a reason for hiding this comment

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

Line is too long. [166/80]

"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}"},

Choose a reason for hiding this comment

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

Space inside } missing.

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.

end
flash[:notice] = l(:notice_successful_create)
pbi_params = {"issue"=>{"tracker_id"=> Tracker.find_by_name('Product Backlog').id,
"sprint_id"=> @sprint.id,

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

end
flash[:notice] = l(:notice_successful_create)
pbi_params = {"issue"=>{"tracker_id"=> Tracker.find_by_name('Product Backlog').id,
"sprint_id"=> @sprint.id,

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

end
flash[:notice] = l(:notice_successful_create)
pbi_params = {"issue"=>{"tracker_id"=> Tracker.find_by_name('Product Backlog').id,
"sprint_id"=> @sprint.id,

Choose a reason for hiding this comment

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

Trailing whitespace detected.

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",

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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",

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

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",

Choose a reason for hiding this comment

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

Trailing whitespace detected.

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 ,

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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 ,

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

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 ,

Choose a reason for hiding this comment

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

Line is too long. [89/80]

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 ,

Choose a reason for hiding this comment

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

Space found before comma.

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 ,

Choose a reason for hiding this comment

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

Trailing whitespace detected.

"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,

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

"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,

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

"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,

Choose a reason for hiding this comment

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

Line is too long. [85/80]

"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,

Choose a reason for hiding this comment

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

Trailing whitespace detected.

"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,

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

"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,

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

"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,

Choose a reason for hiding this comment

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

Line is too long. [93/80]

"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,

Choose a reason for hiding this comment

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

Trailing whitespace detected.

"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,

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

"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,

Choose a reason for hiding this comment

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

Surrounding space missing for operator =>.

"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,

Choose a reason for hiding this comment

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

Trailing whitespace detected.

"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",

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants