Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

dynamically change priority field on basis of assignment group.

sarabjeet
Giga Expert

Hi everyone,

I am trying to set default priority as P4 for a particular assignment group. And I am able to achieve(onsubmit client script) so but if i try to change that the priority in the next step it is not allowing me to do this. For example the default is P4 and i try to change it to P2 and save it doesn't happen. 

Please let me know how can i achieve this requirement.

Thanks,

Sarabjeet

1 ACCEPTED SOLUTION

Murthy Ch
Giga Sage

@sarabjeet 

When you are updating the priority to P2 still it is saving to P4?

If yes its because of your onSubmit() client script

So please use this:

if(g_form.isNewRecord())
{
var a = g_form.getValue('assignment_group');
if (a == 'a56f4cbfdb252410b9450342f396191c') {
g_form.setValue('impact', '14'); // low
g_form.setValue('urgency', '11'); // low
}
}

Thanks,

Murthy

Thanks,
Murthy

View solution in original post

6 REPLIES 6

Murthy Ch
Giga Sage

@sarabjeet 

When you are updating the priority to P2 still it is saving to P4?

If yes its because of your onSubmit() client script

So please use this:

if(g_form.isNewRecord())
{
var a = g_form.getValue('assignment_group');
if (a == 'a56f4cbfdb252410b9450342f396191c') {
g_form.setValue('impact', '14'); // low
g_form.setValue('urgency', '11'); // low
}
}

Thanks,

Murthy

Thanks,
Murthy

Thank you so much Murthy. It worked for me.