Service Catalog - When a laptop is ordered, how do I automatically add a monitor to the REQ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:50 AM
For our Service Catalog, when a certain laptop (RITM) gets ordered I'd like to automatically add a monitor (another RITM) to that REQ. How do I go about doing that? We're only using ITSM (no ITAM) Both of these items already exist in the SC.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 12:07 PM
Hi,
In the workflow for the laptop, you can add a step/action to evaluate if the item they ordered qualifies for the addition of a monitor, if so, you can add the other item to the parent request using an API like so:
So the above can be done inside the workflow as a run script (workflow) or script step (flow).
The above is for non-scoped needs and is pretty clean cut and adds the RITM to the REQ.
If you need more than this, then you can do the same, but add it via script another way like so: https://community.servicenow.com/community?id=community_question&sys_id=fde55f38db44b30814d6fb243996...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 01:24 PM
Hi,
Thanks for marking my reply as Helpful.
If it also helped guide you Correctly, please also mark it as Correct.
Thanks and take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 02:11 PM
Been playing around with this in my pdi for a bit and have a few questions.
I'm adding an Apple iPad to a Developers Laptop (Mac) and the Standard Laptop if one of those two are ordered. Created a very simple workflow on sc_req_item table just to test this script when I place the order and see if it will attach the Apple iPad RITM to the REQ.
Basically copied the script on the docs page you linked to
So how do I know the sys_id of the request (requestID) if each request is going to generate it's own sys_id?
I want the script to only run and add the iPad only if the Standard Laptop or Developers Laptop (Mac) is ordered, so do I need to add some kind of IF statement first? Something like
function ifScript() {
//This is the Developers Laptop and the Standard Laptop
if (current.cat_item == '774906834fbb4200086eeed18110c737' || current.cat_item == '04b7e94b4f7b4200086eeed18110c7fd' )
var catItemId = "4aae94bc975301100f44bfb3f153af27";
var requestId =
var helper = new GlideappCalculationHelper();
helper.addItemToExistingRequest(requestId, catItemId, "1");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 05:31 PM
Hello,
You would use an if activity and the condition builder (you don't need script).
Then if yes, go to a run script activity to execute the script.
You would get the request sys_id from the current RITM's request field?
current.getValue('request');
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!