We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Kenny Caldwell
ServiceNow Employee

This time saving feature allows providers to publish local catalog items to Service Bridge as remote record producers. 

 

A provider can create a remote record producer from the following catalog classes.

  1. Catalog Item
  2. Record Producer
  3. Hardware Catalog
  4. Software Catalog

The catalog item must meet the following requirements.

  1. Must be in a published state
  2. Must be one of the supported classes
  3. Cannot already have been published to service bridge

Catalog items can be published to Service Bridge individually or in bulk. When publishing catalog items in bulk, the default limit is 20 items. The limit can be changed by defining and setting the system property sn_sb_pro.max_batch_size_covertable_catalog_items.

 

Publishing a catalog item to Service Bridge creates a copy of the item as a remote record producer. The remote record producer is associated with the original catalog item via the reference field Created from cat item.

 

Publish individual catalog item to Service Bridge

  1. Navigate to the catalog to be published.
  2. Click the Publish to Service Bridge Related Link

    Catalog Item - Individual - Publish to Service Bridge.png

  3. A remote record producer is created from the catalog item and navigation is directed to the newly created remote record producer.

    RRP created from Publish to SB.png

Publish catalog items in bulk to Service Bridge

  1. Navigate to a list of catalog items to be Published to Service Bridge.
  2. On the list, select the checkboxes for the catalog items to be Published to Service Bridge.
  3. In the Actions on selected rows… menu, click Publish to Service Bridge.

    Bulk Publish - Items selected to publish.png

  4. Publishing to Service Bridge modal is displayed while in progress.

    Bulk Publish - Publish Modal.png

  5. On completion, the results are displayed.

    Bulk Publish - Completion Modal.png

 

After publishing to Service Bridge, items need to be finalized prior to Publishing for synching to consumer instances. Finalization steps include.

  1. Adding a required flow
  2. Adding Consumer Criteria
  3. Adding Persona if required
  4. Verify and update remote record producer content and variables. Example reference variables may need to be changed to remote choices.
24 Comments
spike
Mega Sage

Have you actually done that thing with the variable set? How did you get the flow to decide which SR to raise? And how did you get it into the Raise Catalog Item action?

 

Thanks.

Patryk Oshibuch
Tera Explorer

Provider Task has field in JSON format of all variables. I map them to RITM questions in the flow.
If both (Remote Record Producer and Catalogue Item) have a all questions from same Variable set than you can loop just this JSON from Provider task and populate questions on RITM. 

How to create a RITM from code:
https://www.servicenow.com/community/developer-forum/how-to-create-request-item-from-script/m-p/1439...

But I am not sure if that is a good way to do that. That's why I am looking for a good solution.

spike
Mega Sage

Thanks for that. The problem with that code is that it's specific to each catalog item you've got. You might be matching questions across provider and consumer and then into your existing catalog item, but each catalog item will have different questions.

 

I'd say it's actually easier (because there's less code) to do this in a flow:

 

1. "Get catalog variables" from the producer variables from the provider task, using the catalog item as a template.

2. "Submit catalog item request" for the internal version of the catalog item, using the variables you got from step 1.

 

Because (in my scenario) I've published the internal catalog item to Service Bridge, both have the same variables so I can just drag and drop the pills in.

 

While this is not dynamic (you need a different flow for each SR), in the same way the code the link shows is not dynamic, I'd suggest this way has much less scope for error.

 

I'm wondering if I can make this dynamic, but whatever I come up with I end up building some sort of controller that works out what flow to run. At which point you might as well just run the flow (since each SR can point to a different flow, why point it to a controller to make life harder?)

Patryk Oshibuch
Tera Explorer

I made that dynamic 
1. get JSON of questions from Provider task

2. Loop through those questions - I will be the array of JSON objects.

3. Map each question to proper cat item question 

(function execute(inputs, outputs) {
    var providerTask = inputs.provider_task;
    var cat_item_id = providerTask.record_producer.cat_item;
    var varArray = JSON.parse(providerTask.vars_json);

    var cartId = GlideGuid.generate(null);
    var cart = new Cart(cartId);
    var item = cart.addItem(cat_item_id, 1);

    for(var i =0; i < varArray.length; i++){
        var varGR = new GlideRecord('item_option_new');
        if(varGR.get(varArray[i].questionID)){
            cart.setVariable(item, varGR.name, varArray[i].value);
        }
    }
    var rc = cart.placeOrder();

    outputs.rimt = rc;


})(inputs, outputs);

 

spike
Mega Sage

That is beautiful mate. Works an absolute treat. Many thanks for that.

 

I've now got a dynamic flow that I can use on any catalog task that is published to the Service Bridge.

 

Brilliant.

Patryk Oshibuch
Tera Explorer

@spike 
No problemanother question:
Do you know if we can do something with the comments that are sync between provider and consumer?
I see that if someone will place the comment than on other side there is no information who placed such comment. 

Phillip Godwin
ServiceNow Employee

hi @Patryk Oshibuch  - Service Bridge 2.2 introduced the Journal Field Framework that allows the control of comment syncing and adds the feature that attributes comments to the user.

Patryk Oshibuch
Tera Explorer

@Phillip Godwin Thank you 🙂

Do you have any plans for re-sync the Catalogue item with remote record producer?

Here under release notes you mentioned that there is an option to publish catalogue item to Service Bridge, but what if such catalogue item will get an update? 
Do we need to maintain both separately? 

Br,
Patryk Oshibuchi

Phillip Godwin
ServiceNow Employee

hi - yes, right now they will both need to be maintained separately. There has been some discussion about the potential for keeping them in sync, but would be a challenge so no plans yet.

Tanushree Maiti
Giga Sage

Useful information. Thank you for the information how a catalog can be published in Service Bridge with step by step instructions!