urgent - How to set default value to Assignment Group field in Transform Maps?

Ashirav
Tera Expert

Hi all,

I have created a Change Request via Inbound Email Actions xls attachment. For that I have mapped the attachment fields to the Change Request fields using Transform Maps.

I am trying to fix a default value to the Assignment Group via a script but its (obviously) not working:-

find_real_file.png

 

Please guide me what I am doing wrong.

Thanks.

6 REPLIES 6

AbhishekGardade
Giga Sage

You can set default value of assignment group using Businee rule. Why you are setting it from field map

Thanks,

Abhishek

Thank you,
Abhishek Gardade

Hello Ashirav

add this line after setting the assignment group in your current script:

gr.setDisplayValue('assignment_group','NOC Tier 1');

gr.update();

OR

gr.setValue('assignment_group','sysID of group');

gr.update();

 

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ashirav,

in your addQuery() you have not given anything so it is not querying anything

if you want to set default value then return the sys_id of the assignment group also update the reference value field name to sys_id

answer = (function transformEntry(source) {

// Add your code here
return "sysId"; // return the value to be put into the target field

})(source);

test once and let me know

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

johnfeist
Mega Sage
Mega Sage

Hi Ashirav,

I echo Abishek's question. 

If you are using an inbound action that is pointing to a change, you just need current.assignment_group = <fill in the group>.  If all must go to the same group you can either embed the sys_id or do a table lookup on the group to get the sys_id.  Best practice would have you define a property that your script can reference to get the default assignment group name.  That way if you need to change the default assignment group you don't have to edit the code.

Hope this helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster