State should be inprogress when assignment group is not empty and if i change state to onhold it is not updating.

Mallika4
Tera Contributor

Hello Developers!

My requirement is when assignment group is not empty then state should be change to in progress.

I wrote a client script code it is working fine. Here is the code

function onLoad() {
var assign = g_form.getValue('assignment_group');
var assignedto = g_form.getValue('assigned_to');
var state = g_form.getValue('state');
if(assign != '' || assignedto != '')
{
g_form.setValue('state','2');
}

But, the issue is when i change state to another state like on-hold, it is not updating to on-hold, it is still showing inprogress only.

So, please help me out on this issue.

Thank you!

1 ACCEPTED SOLUTION

Willem
Giga Sage
Giga Sage

Hi Mallika,

Create a business rule for this like below to do this. That way no scripting is needed:

find_real_file.png

 

find_real_file.png

 

This will set the State to 'In progress' when the Assigned to or Assignment group is not empty and the State is in New. For all other states ('closed'/'cancelled' etc) I assume you would not want to change the state. But of course you can change the conditions to your liking.

View solution in original post

6 REPLIES 6

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

This is OOB on incident module. You can check that. 

We do this using BR and not client Script where we put a condition like if the state was new and assigned to changed from empty to something else then mark it as IN progress.


Thanks,
Ashutosh

Sudhanshu Talw1
Tera Guru

Hi,

BR works for it.

Achieving via client side is not possible.

Thanks

Sudhanshu

Willem
Giga Sage
Giga Sage

Hi Mallika,

Create a business rule for this like below to do this. That way no scripting is needed:

find_real_file.png

 

find_real_file.png

 

This will set the State to 'In progress' when the Assigned to or Assignment group is not empty and the State is in New. For all other states ('closed'/'cancelled' etc) I assume you would not want to change the state. But of course you can change the conditions to your liking.

Mallika4
Tera Contributor

It is working fine when we change assignment group but when we create incident with assignment group it is not showing inprogress, it is showing new only. I want to update the state inprogress when we open the record.

Could you please suggest me any other possible way on that?

Thank you!