urgent - How to set default value to Assignment Group field in Transform Maps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 05:12 AM
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:-
Please guide me what I am doing wrong.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 05:14 AM
You can set default value of assignment group using Businee rule. Why you are setting it from field map
Thanks,
Abhishek
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 05:17 AM
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
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 05:15 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 05:20 AM
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
:{)
Helpful and Correct tags are appreciated and help others to find information faster