A new Flexera Community experience is coming on November 25th. Click here for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sending custom variables to ServiceNow from App Broker

I see the list of App Broker variables listed in the Admin guide: https://helpnet.flexerasoftware.com/appportal2019r1/default.htm#helplibrary/AP_VariablesRef.htm#variables_2522444554_1007497%3FTocPath%3DApp%2520Portal%2520%252F%2520App%2520Broker%2520System%25C2%25A0Administration%7C_____9

However, I'm struggling to send custom variables from App Broker to ServiceNow; examples include keywords, images.

(2) Solutions

I have a few thoughts to share on this topic:

  1. Custom variables can be configured at a global catalog level and also at an individual catalog item level.  When defining custom variables at the global catalog level, those variables get copied into every new catalog item when it gets created.  Existing catalog items will not inherit newly added custom variables.  You can modify/remove the global variables from an individual catalog item, and you can add other custom variables to the individual catalog item as desired.
  2. Prior to App Broker 2019 R1, custom variables were not being resolved during the catalog sync process, so you would end up with the custom variable name in the ServiceNow catalog item instead of the value.  This has been addressed in 2019 R1, so the value is properly resolved and synced into ServiceNow.  If you use a custom variable in the catalog sync configuration and that custom variable is not included on a particular catalog item, you will still see the behavior where the variable name is synced instead of a value, so you need to make sure that the custom variable exists on all catalog items that will be synced into ServiceNow.  That variable can have a blank value, but the variable needs to exist on each catalog item.
  3. I'm not sure what criteria are used to determine which variables get documented in that HelpNet topic, but that topic is not a comprehensive list of variables.  For the catalog sync process from App Broker to ServiceNow, you can make a variable out of any column name in the WD_WebPackages table.  For example, ##ImagePath## would resolve to the value of the ImagePath column in the WD_WebPackages table.  Note that if you were to use that variable in the catalog sync process, it would pass the filename of the image, but would not sync the actual file.  The icons/images that get synced into ServiceNow are actually done through a separate call embedded in the App Broker application code (not exposed in the UI anywhere).  You can see that in the ServiceNowIntegration.log...

    Added image while creating Service Catalog for SN Catalog ID a54ea1dadbe3230089da0181ca96196c ImagePath:c:\program files (x86)\flexera software\app portal\web\Backgrounds\Packages\Visio.png.	l1	2/12/2019 8:04:02 PM	4 (0x0004)
    
    It's important to note that we only sync those icons into the "Icon" field within the ServiceNow catalog item.  This icon is the field that is used in the ITIL view of the service catalog, as well as the <myinstance.service-now.com>/ess portal.  However, the <myinstance.service-now.com>/sp portal (Service Portal) uses a different field ("Image", I believe, but might be "Picture").  We do not populate that field as part of the catalog sync process, so if you use the Service Portal view and want the icons to appear, you either need to manually copy these images into the proper field of each catalog item, or you need to modify the design of the Service Portal to pull the icons from the "Icon" field instead.
  4. If you want to add custom fields to your catalog items in ServiceNow, you can do that.  You aren't limited to just the fields that we include in the default integration.  As an example, you might have an approval process that requires an "application owner" to approve all requests for software titles that they are responsible for.  You could add a custom variable called ##Custom_ApplicationOwner## to each catalog item in App Broker.  Then in order to get that value into ServiceNow, you would go into the Import Service (in ServiceNow under the Flexera Software App Portal application) and modify the form layout to add a custom field called Application Owner.  You would do the same to the Catalog Items table in ServiceNow and then you'd configure the transform map to map the new field between the Import Service and the Catalog Items.  After doing this, when you create the default catalog operations under ServiceNow Integration in the App Broker Admin UI, it will bring that custom field in from the WSDL.  If you've already configured the integration between App Broker and ServiceNow, you should Delete Catalog Operations and Mapping first and then Create Default Catalog Operations.  After creating the default catalog operations, you can go into the Insert and Upsert operations under ITSM Integration and add the custom variable to the new custom field.  Make sure you save your changes.  After you've done all that, you'll want to restart the ESDService and perform an IISReset, then force a full sync of the catalog.

I think that's all I have for now.  Hopefully, that addresses your questions and gives a little more detail regarding how variables and catalog sync work.

 

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

View solution in original post

CharlesW
By Level 12 Flexeran
Level 12 Flexeran

Mel,
      If you need to resolve a custom variable for your ITSM action, then you will want to specify the variable ##Custom_<variableName>##.

For example: ##Custom_Model##

This should resolve to the variable value that you have defined on your catalog item.

Thanks,

Charles

View solution in original post

(5) Replies

I have a few thoughts to share on this topic:

  1. Custom variables can be configured at a global catalog level and also at an individual catalog item level.  When defining custom variables at the global catalog level, those variables get copied into every new catalog item when it gets created.  Existing catalog items will not inherit newly added custom variables.  You can modify/remove the global variables from an individual catalog item, and you can add other custom variables to the individual catalog item as desired.
  2. Prior to App Broker 2019 R1, custom variables were not being resolved during the catalog sync process, so you would end up with the custom variable name in the ServiceNow catalog item instead of the value.  This has been addressed in 2019 R1, so the value is properly resolved and synced into ServiceNow.  If you use a custom variable in the catalog sync configuration and that custom variable is not included on a particular catalog item, you will still see the behavior where the variable name is synced instead of a value, so you need to make sure that the custom variable exists on all catalog items that will be synced into ServiceNow.  That variable can have a blank value, but the variable needs to exist on each catalog item.
  3. I'm not sure what criteria are used to determine which variables get documented in that HelpNet topic, but that topic is not a comprehensive list of variables.  For the catalog sync process from App Broker to ServiceNow, you can make a variable out of any column name in the WD_WebPackages table.  For example, ##ImagePath## would resolve to the value of the ImagePath column in the WD_WebPackages table.  Note that if you were to use that variable in the catalog sync process, it would pass the filename of the image, but would not sync the actual file.  The icons/images that get synced into ServiceNow are actually done through a separate call embedded in the App Broker application code (not exposed in the UI anywhere).  You can see that in the ServiceNowIntegration.log...

    Added image while creating Service Catalog for SN Catalog ID a54ea1dadbe3230089da0181ca96196c ImagePath:c:\program files (x86)\flexera software\app portal\web\Backgrounds\Packages\Visio.png.	l1	2/12/2019 8:04:02 PM	4 (0x0004)
    
    It's important to note that we only sync those icons into the "Icon" field within the ServiceNow catalog item.  This icon is the field that is used in the ITIL view of the service catalog, as well as the <myinstance.service-now.com>/ess portal.  However, the <myinstance.service-now.com>/sp portal (Service Portal) uses a different field ("Image", I believe, but might be "Picture").  We do not populate that field as part of the catalog sync process, so if you use the Service Portal view and want the icons to appear, you either need to manually copy these images into the proper field of each catalog item, or you need to modify the design of the Service Portal to pull the icons from the "Icon" field instead.
  4. If you want to add custom fields to your catalog items in ServiceNow, you can do that.  You aren't limited to just the fields that we include in the default integration.  As an example, you might have an approval process that requires an "application owner" to approve all requests for software titles that they are responsible for.  You could add a custom variable called ##Custom_ApplicationOwner## to each catalog item in App Broker.  Then in order to get that value into ServiceNow, you would go into the Import Service (in ServiceNow under the Flexera Software App Portal application) and modify the form layout to add a custom field called Application Owner.  You would do the same to the Catalog Items table in ServiceNow and then you'd configure the transform map to map the new field between the Import Service and the Catalog Items.  After doing this, when you create the default catalog operations under ServiceNow Integration in the App Broker Admin UI, it will bring that custom field in from the WSDL.  If you've already configured the integration between App Broker and ServiceNow, you should Delete Catalog Operations and Mapping first and then Create Default Catalog Operations.  After creating the default catalog operations, you can go into the Insert and Upsert operations under ITSM Integration and add the custom variable to the new custom field.  Make sure you save your changes.  After you've done all that, you'll want to restart the ESDService and perform an IISReset, then force a full sync of the catalog.

I think that's all I have for now.  Hopefully, that addresses your questions and gives a little more detail regarding how variables and catalog sync work.

 

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".
Question: In terms of this last part of the setup - "After creating the default catalog operations, you can go into the Insert and Upsert operations under ITSM Integration and add the custom variable to the new custom field." What this customer is trying to do is setup different values on the Catalog Items themselves using custom variables and then have those values get pushed over via the Import Service. Is this possible? Versus sending a static value of xyz for all Catalog Items. For example: A new custom variable of "Model" was setup as instructed, the system reset as instructed but what value would I input on the ITSM Integration Insert and Upset operations? Meaning, how do I make the tie between the custom variable on ITSM operations and the custom variables on the individual Catalog Items in App Broker?
CharlesW
By Level 12 Flexeran
Level 12 Flexeran

Mel,
      If you need to resolve a custom variable for your ITSM action, then you will want to specify the variable ##Custom_<variableName>##.

For example: ##Custom_Model##

This should resolve to the variable value that you have defined on your catalog item.

Thanks,

Charles

Based on recommendations provided, I added a Custom field (##LicReserveCount##) to a catalog item and

then added LicReserveCount to ServiceNow under mapping.

However, I can not see LicReserveCount in Servicenow for that Catalog Item.

Do we have some restrictions that only WD_Packages related Columns can be added?

LicReserveCount is a column in the WD_PackageRequests table.  These values are related to an individual request for a package, not related to the package itself.  Keep in mind that this is a "Catalog Sync" to ServiceNow.  We are syncing properties of catalog items, not properties of requests.  As I stated in a previous response, you can pass any column from the WD_WebPackages table as part of the catalog sync process.

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".