- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 05:45 AM
Hello Developers,
I have requirement Integration ServiceNow to Greenhouse , and Authentication type is Basic authentication.
Client want a way that with password they want basic authentication
Integration - Type - OUTBOUND
Please suggest me best solution which I can implement and close the task.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 09:23 AM
Hello @raj12345
1. Create Outbound REST Message - Here is an example of Dummy Outbound rest message
2. Define the POST HTTP Method: In the content field under HTTP Query parameters you can pass the required attributes with their corresponding variables (these variables can be used to pass the value from ServiceNow)
3. TEST HTTP POST Method: Under Related Links of the POST HTTP Method, click on Auto-generate variables. You will find the related List "Variable Substitutions" to auto-populate these two variables to whom you can assign Test Value as shown below. Now, click Test under Related Links
You will see a successful POST HTTP Response (201)
4. Develop Business Rule: Under Related Links of HTTP POST method, click on "Preview Script Usage" and use in the Script (Under Advanced Tab) of your business rule as shown below:
NOTE: You can modify the filter conditions as per your requirement:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
// Check if the record has been updated
if (!previous || current.title !== previous.title || current.name !== previous.name) {
var title = current.title;
var name = current.name;
try {
var r = new sn_ws.RESTMessageV2('Dummy User Creation', 'Create User');
r.setStringParameterNoEscape('job', title);
r.setStringParameterNoEscape('name', name);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.log('VJ1: ' + httpStatus);
gs.log('VJ1: ' + responseBody);
} catch (ex) {
var message = ex.message;
}
} else {
gs.log('VJ1: No updates');
}
})(current, previous);
Use the above learning to implement your solution to Greenhouse.
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 05:50 AM
Hi @raj12345
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 08:18 AM - edited ‎03-24-2025 08:24 AM
Hello @raj12345
If you are new to ServiceNow outbound Integration then I would suggest to rely on ServiceNow official documentation as much as possible. Such information will help you learn about what HTTP Methods are, what are request and response headers, http query parameters etc.
https://developer.servicenow.com/dev.do#!/learn/learning-plans/xanadu/servicenow_application_develop...
https://www.servicenow.com/community/developer-articles/outbound-rest-integration/ta-p/2861448
Pre-requisites before any development:
1. Understand the scope of work/requirement. For example: From ServiceNow to Greenshouse you should be performing these three HTTP methods: Retrieve (GET), create(POST) and update (PUT)
2. Understand the list of various Greenhouse APIs available from it's official documentation.
3. You can always practice a dummy integration in your ServiceNow PDI to get some hands-on experience (shown below)
Step#1. Navigate to System Web Services > Outbound > REST Message and Create an Outbound REST message.
Step#2: While Creating the above, you can select Basic Authentication (as per your requirement) and create a new Basic Authentication credentials. There is no way you can test them within ServiceNow, hence I would advise you to look at the character limit of password field to ensure your password length is captured in the password field.
Step#3: Automatically ServiceNow will add a Default GET HTTP method within the REST Message (under HTTP Methods related list) which you created. So, you can rename it or create similar other HTTP methods available as per your requirement.
Step#4: Test the HTTP method by clicking Test under Related links of the HTTP Method:
You may get a response as XML or other format however you may wanna GET the JSON response as it is easier to parse in your script. So, ensure to add HTTP Headers as shown below:
NOTE: always say the HTTP method when you are updating any such field else you will notice a green bar in front of the name in HTTP headers which denotes you haven't saved it.
Step#5: Instead of providing the value in the endpoint, learn about providing variable in the endpoint as shown below:
Save and then under related links, click Auto-generate variables and then provide the test value and then click Test again:
Step#6: Practice scripting - Background script. Under related links of HTTP method, click Preview Script Usage and then copy paste the script/code to background script (System Definition > Scripts - Background). You need to add gs.info before the try block end to print the output as shown below:
Step#7: Modify the HTTP method and script as shown below to populate the city name via variable instead of hardcoding it. Assume, you have populated city in the sys_user table for yourself and you are the logged in user who is executing this background script.
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 05:49 AM
Thank you Vishal.
Requirement: Integration of Greenhouse with ServiceNow (Outbound Integration)
We need to integrate Greenhouse with ServiceNow. The scenario is as follows:
In ServiceNow, a user is created from a database (e.g., XY DB), and the user record is displayed as "created by XY".
Our goal is to implement a solution where, every week, the user records created in ServiceNow via XY DB are sent to Greenhouse, and a corresponding user record is created in Greenhouse.
All the integration work needs to be handled on the ServiceNow side, with the data being sent to Greenhouse.
This is exact requirement if possible to Provide me High level solutions.
Thnaks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 09:23 AM
Hello @raj12345
1. Create Outbound REST Message - Here is an example of Dummy Outbound rest message
2. Define the POST HTTP Method: In the content field under HTTP Query parameters you can pass the required attributes with their corresponding variables (these variables can be used to pass the value from ServiceNow)
3. TEST HTTP POST Method: Under Related Links of the POST HTTP Method, click on Auto-generate variables. You will find the related List "Variable Substitutions" to auto-populate these two variables to whom you can assign Test Value as shown below. Now, click Test under Related Links
You will see a successful POST HTTP Response (201)
4. Develop Business Rule: Under Related Links of HTTP POST method, click on "Preview Script Usage" and use in the Script (Under Advanced Tab) of your business rule as shown below:
NOTE: You can modify the filter conditions as per your requirement:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
// Check if the record has been updated
if (!previous || current.title !== previous.title || current.name !== previous.name) {
var title = current.title;
var name = current.name;
try {
var r = new sn_ws.RESTMessageV2('Dummy User Creation', 'Create User');
r.setStringParameterNoEscape('job', title);
r.setStringParameterNoEscape('name', name);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.log('VJ1: ' + httpStatus);
gs.log('VJ1: ' + responseBody);
} catch (ex) {
var message = ex.message;
}
} else {
gs.log('VJ1: No updates');
}
})(current, previous);
Use the above learning to implement your solution to Greenhouse.
Hope that helps!