The CreatorCon Call for Content is officially open! Get started here.

HazzN
ServiceNow Employee
ServiceNow Employee

Google Cloud - Apigee is an API Proxy that can be used to manage APIs at scale. I was apart of an engagement last year in which the client used Apigee to manage their APIs. I had no experience with it before and had to figure it out along the way. Anyways, I have captured a basic scenario of using Apigee API Proxy to integrate Jira (Or another system in your case) and ServiceNow. Hopefully someone finds this useful in the future.

 

This was 1 of a few different scenarios i had to put together, the goal was bi-directional integration between the two systems.

 

The tables:

ServiceNow - SAFe Story (Can use any table you want)

Application: Jira - Issue with type of Story (Or choose application for your needs)

Apigee - 2xAPI Proxies one each way.

 

In ServiceNow we're using Flow Designer and the OOTB "Create Issue" action for Jira Spoke with just a slight modification, as well as Web Service Import Sets for the return traffic. In Jira we're using Project Automation and using a custom JSON for use with ServiceNow's inbound web service import set tool. The scenario called for ServiceNow --> Jira and then any updates in Jira, but you could also configure it to be started either/or or both.

 

1. ServiceNow Flow Designer Configurations/Web Service Import Set for Inbound traffic

 

Define your trigger:

HazzN_0-1729894224761.png

 

 

Make a copy of the OOTB "Create Issue" Action that is part of the Jira Spoke for both best practice and the ability to edit the proxy endpoints into the REST Step (your using the individual.ni.io or hostname on APIGEE:

HazzN_1-1729894224761.png

 

 

Put together the rest of the Flow, actions include the action you just created above as well as updating the record with the correlation ID to tie the systems together:

HazzN_2-1729894224763.png

 

HazzN_3-1729894224762.png

 

Now we're going to make the Web Import Set for the inbound traffic from the Jira Update:

 

Web Service Import Set:

HazzN_4-1729894224764.png

 

Transform Setup to map Jira to ServiceNow:

HazzN_5-1729894224765.png

 

 

 

 

2. APIGEE Configurations

 

Assuming you have a Google Cloud account, go to API Proxies under Proxy Development:

HazzN_6-1729894224765.png

 

 

Create a new proxy, for this example Im using the "ServiceNow-Jira-Test" proxy.

HazzN_7-1729894224766.png

 

Anytime you save/make a change it'll add it as a revision in Apigee if the current version is deployed. 

Alright now we can setup the information we need to successfully create the Issue in Jira, first we need to familiarize ourselves with Key Value Mappings and (for the purpose of scenario) Basic Auth policies. 

 

Key Value Mapping policies in Apigee are basically in-proxy callable values for runtime only. You can assign them to specific environments or different proxies within the same environment and it will steer to the correct policy at run time. In this example, we make 2 KVM policies, 1 for putting or setting the values, and 2 for the GET/retrieval of the first policy. See below:

 

First we create a Key Value Mapping, by going to Environments > Go to Environment (Eval here) > Key Value Maps Tab:

HazzN_8-1729894258066.png

 

 

Then we setup the first KVM policy, where the mapIdentifier attribute calls the KVM Mapping you just made previously. Your also setting up parameter (KVM Mapping before), and the values (actual values) to be passed to the second policy. It should be noted the KVM is auto-encrypted. If you want to mask the info simply add the prefix "private." in front of the reference variable.

HazzN_9-1729894258066.png

 

 

Setup the Second Policy, Note the variables your creating here and the mapIdentifier calling the first policy:

HazzN_10-1729894258067.png

 

Now its time to setup the Basic Auth Policy, remember the variables above have an index which is in order from the very first policy, so username will be first, password will be second. Map accordingly.

HazzN_11-1729894258067.png

 

 

These policies should go in the PRE-FLOW for the REQUEST on the TARGET endpoint

HazzN_12-1729894258067.png

 

3. Jira Configurations (Example)

 

Setup Project Automation accordingly:

HazzN_13-1729894258068.png

 

Send Web Request Specifics, using custom data for web request for the correct JSON formatting needed in ServiceNow:

HazzN_14-1729894258067.png

 

 

 

Lets test:

 

ServiceNow Flow runs and updates the record with correlation ID:

HazzN_15-1729894286312.png

 

 

Apigee (See Request):

HazzN_16-1729894286312.png

 

Jira side:

HazzN_17-1729894286311.png

 

 

Its essentially the same process for the update to ServiceNow on the way back from Jira:

HazzN_18-1729894286314.png

 

Apigee:

HazzN_19-1729894286313.png

 

 

ServiceNow:

HazzN_20-1729894286315.png

 

 

Thanks for Reading! Let me know if you have any questions!