Assignment group Mapping requirement through script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-09-2024 01:05 AM
Hi All,
I have a requirement on assignment group mapping for Integration tickets, ServiceNow to FreshService tool need to map like this group mention below.
FS | ServiceNow Group |
CommandCenter | |
MSGSrv support | |
MSGSrv |
we have integrated with Fs tool when ticket create in FreshService it will reflect in Snow but assignment group not populating in Snow because there assignment group naming is different so we need to set mapping for that, So How can I configured for this mapping.
Please anyone help me or suggested any idea about that.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-09-2024 01:18 AM - edited ā04-11-2024 12:33 AM
Hi,
You could work with a decision table. Create the decision table with the external name and internal reference to prevent issues when your internal name changes. You can call the decision table via your (interface) script : https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server/sn_dt-namespace/Decision...
Or use the code generation from the Decision Builder : https://docs.servicenow.com/bundle/washingtondc-build-workflows/page/administer/decision-table/task/...
A less stable, less maintainable solution would be a system property where you maintain the mapping in a JSON format. Note, you will get it as text, so you need to parse it. I would not use the ServiceNow Group name, but the sysId, so you can parse it directly and have no issues when the groupname changes.
Simplified example as backgroundscript:
var sysPropText = '{"Asset Management" : "CommandCenter","Deskside Support" : "MSGSrv support","Deskside Support 2" : "MSGSrv"}';
var sysProp = JSON.parse(sysPropText);
gs.info(sysProp["Asset Management"]);
//Result : *** Script: CommandCenter
Hope this helps.