Clear Assigned To when Assignment Group is Change in SCtask

sasipriya
Tera Contributor

Hi Team,

 

  Is there any way to clear the "Assigned to:" when you change the "Assignment Group"?

  I have seen a couple of times where for example the SCtask Assignment Group is set to Desktop Support and the assigned to is Joe, then I would set the SCtack Assignment Group to Desktop Architecture, hit save, and it would keep the Assigned to as Joe even though I am not in that group.

sasipriya_0-1683741409553.png

 

Thanks,

Sasipriya.

2 ACCEPTED SOLUTIONS

Ashir Waheed
Kilo Sage
Kilo Sage

Hi @sasipriya 

 

To clear the Value of assigned to field when assignment group changes you will need to create On change client script. Follow the steps to achieve this.

 

1. Create a OnChange client script for variable assignment group.

2. Select the table as your requirement.

AshirWaheed_0-1683741950703.png

 

3. Save the record.

 

Now you should be able to clear Value from assigned to field when assignment group changes

 

Regards,

Ashir Waheed

View solution in original post

Karan Chhabra6
Mega Sage
Mega Sage

Hi @sasipriya ,

 

You should be clearing out values only if the new value is different from the previous value, you can achieve this via onChange client script, paste the code below in onChange client script, field name would be 'assignment group'

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading){
     return;
}
 if(newValue != oldValue){
g_form.clearValue('assigned_to');
}
}

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!

View solution in original post

5 REPLIES 5

Prince Arora
Tera Sage
Tera Sage

@sasipriya 

 

Write a onchange client script on Assignment group and mention the script as below:

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading)
return;
 g_form.setValue('assigned_to', '');
}

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.
 

@sasipriya 

 

I am not sure, if you have seen my solution too?

This is also a tested solution in my PDI.

PrinceArora_0-1683794055433.png

 

Ashir Waheed
Kilo Sage
Kilo Sage

Hi @sasipriya 

 

To clear the Value of assigned to field when assignment group changes you will need to create On change client script. Follow the steps to achieve this.

 

1. Create a OnChange client script for variable assignment group.

2. Select the table as your requirement.

AshirWaheed_0-1683741950703.png

 

3. Save the record.

 

Now you should be able to clear Value from assigned to field when assignment group changes

 

Regards,

Ashir Waheed

Karan Chhabra6
Mega Sage
Mega Sage

Hi @sasipriya ,

 

You should be clearing out values only if the new value is different from the previous value, you can achieve this via onChange client script, paste the code below in onChange client script, field name would be 'assignment group'

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading){
     return;
}
 if(newValue != oldValue){
g_form.clearValue('assigned_to');
}
}

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!