def bulk_change_form
# Load maximum number of issues
- @criteria_params = criteria_params
+ @criteria_params = criteria_params_to_save
@criteria_params['pageSize'] = -1
issue_filter_result = Internal.issues.execute(@criteria_params)
@issue_query = issue_filter_result.query
@issues_result = issue_filter_result.result
- @issue_keys = @issues_result.issues.map {|issue| issue.key()}.join(',') if !@issues_result.issues.empty?
-
+ @issue_keys = @issues_result.issues.map {|issue| issue.key()}.join(',') unless @issues_result.issues.empty?
render :partial => 'issues/bulk_change_form'
end
# POST /issues/bulk_change
def bulk_change
verify_post_request
-
- render :text => '', :status => 200
+ result = Internal.issues.bulkChange(params, "")
+ if result.ok
+ render :text => params[:criteria_params], :status => 200
+ else
+ @errors = result.errors
+ render :partial => 'issues/bulk_change_form', :status => 400
+ end
end
<form id="bulk-change-form" method="post" action="<%= ApplicationController.root_context -%>/issues/bulk_change">
<input type="hidden" name="issues" value="<%= @issue_keys -%>">
+ <input type="hidden" name="criteria_params" value="<%= @criteria_params.to_query -%>">
<fieldset>
<div class="modal-head">
<h2><%= message('issue_filter.bulk_change.form.title', {:params => @issues_result.issues.size.to_s}) -%></h2>
</form>
<script>
$j("#bulk-change-form").modalForm({success:function (data) {
- window.location = baseUrl + '/issues/search/' + data;
+ window.location = baseUrl + '/issues/search?' + data;
}});
</script>
\ No newline at end of file