Fixes #3880 - Changing ticket status from "new" to any other status always results in uncommited status "closed".
This commit is contained in:
parent
58807875e9
commit
3b18bb36dd
2 changed files with 35 additions and 0 deletions
|
@ -139,6 +139,11 @@ class App.FormHandlerCoreWorkflow
|
|||
if valueFound
|
||||
item.default = paramValue
|
||||
item.newValue = paramValue
|
||||
else if params.id
|
||||
obj = App[ui.model.className].find(params.id)
|
||||
if obj && obj[item.name]
|
||||
item.default = obj[item.name]
|
||||
item.newValue = obj[item.name]
|
||||
else
|
||||
item.default = ''
|
||||
item.newValue = ''
|
||||
|
|
|
@ -2316,4 +2316,34 @@ RSpec.describe 'Ticket zoom', type: :system do
|
|||
expect(page.all('select[name=owner_id] option').map(&:value)).to include(agent2.id.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'Changing ticket status from "new" to any other status always results in uncommited status "closed" #3880', authenticated_as: :authenticate do
|
||||
let(:ticket) { create(:ticket, group: Group.find_by(name: 'Users')) }
|
||||
let(:workflow) do
|
||||
create(:core_workflow,
|
||||
object: 'Ticket',
|
||||
condition_selected: {
|
||||
'ticket.priority_id': {
|
||||
operator: 'is',
|
||||
value: [ Ticket::Priority.find_by(name: '3 high').id.to_s ],
|
||||
},
|
||||
},
|
||||
perform: { 'ticket.state_id' => { operator: 'remove_option', remove_option: [ Ticket::State.find_by(name: 'pending reminder').id.to_s ] } })
|
||||
end
|
||||
|
||||
def authenticate
|
||||
workflow
|
||||
true
|
||||
end
|
||||
|
||||
before do
|
||||
visit "#ticket/zoom/#{ticket.id}"
|
||||
end
|
||||
|
||||
it 'does switch back to the saved value in the ticket instead of the first value of the dropdown' do
|
||||
page.select 'pending reminder', from: 'state_id'
|
||||
page.select '3 high', from: 'priority_id'
|
||||
expect(page).to have_select('state_id', selected: 'new')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue