- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 05:09 AM
Hi,
take a look in the Pre Post Processing scripts, there are pre processing scripts like 'Handle Model and Manufacturer for HMC' which you can use as example.
You find it directly in the menu with 'pre post' or sa_pattern_prepost_script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 05:40 AM
Thanks for your answer.
I'm a little bit confused, because ServiceNow is doing it directly, for example in the Network Switch pattern -> discovery -> Step 3 Insert model to cmdb_ci_ip_switch.
If I'm doing the same in a pattern extension it doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 05:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 05:56 AM
@AchimM279672093
I assumed you get the model name, which you can't enter directly in the pattern as you need to look up the value. This would be possible with pre post scripts as MakeAndModelJS function can be used there.
If you have the value available you can add it in the pattern. When there is need to transform it you can use EVAL scripts.
This is the kb article: KB0647736 a good explanation video is: https://youtu.be/wuuG85XtL1s?si=wMhS103STTfa9nMj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2026 05:28 AM
I was able to extract the model using the pattern from the SNMP sysdescr. However, I can't write this value to the model_id field because it expects a sys_id there. In the video you mentioned, this is done without a sys_id, but it doesn't show whether it actually works. I doubt it does. I’d like to stick with the pattern, since that’s probably the way of the future, but there’s no way to call MakeAndModelJS (I get errors in EVAL) or an alternative method that replaces MakeAndModelJS.
I’m aware of the pre/post scripts, but I haven’t implemented them yet. I also don’t know how to use the variables/values determined in the pattern in the post script afterward.
Has anyone done this before?
Used MakeAndModelJS in pre/or post scripts with parameter passing from the pattern?