ServiceNow - create Incident from issue
Step 1 - Register in ServiceNow
Goto System OAuth → Application Register
Click New
Fill in the details needed to update ServiceNow data. (our example uses Global scope)
Enter the Redirect URL, this is the URL that is the Callback URLÂ specified on the OAuth Authentication in iHUB.
In our example, we generated a Client Secret
Step 2 - Create Authentication in iHUB
In iHUB create a new OAuth 2 authenticationÂ
Use the Client ID and Client Secret from the ServiceNow registration in Step 1.
Add the instance URL with the following path param.
 <instance-url>/oauth_auth.do
 <instance-url>/oauth_token.do
Step 3 - Authorize the apps to talk to each other
Click Authorize when all data is entered.Â
Do the OAuth dance, where you will be redirected to a consent form, click Allow.
Step 4 - Create iHUB REST Action to call ServiceNow
Create a new Action in iHUB
Select POST method and enter the URL <instance-url>/api/now/v1/table/incident
Content-Type: application/json
Body
{"short_description":"{{issue.summary}}", "comments":"{{issue.description}}"}
Click Triggers and select the event, cron or leave blank if you plan to use Post Function.
In this example, we will use Issue Create Event
Step 5 - Test our integration and view result
Test the integration by creating an issue in the project that the iHUB action is triggered by
On the issue, you can view the Integration result or view it from the Action Log.
View result in iHUB Execution log
Click View to see more details, such as the INC number.
Step 6 - View result in ServiceNow
Goto Incidents in ServiceNow
Search for the INC number that the log displayed.
Click to view the Incident
In our example we used the default encoding which is UTF-8, other encodings are supported as well.
Step 7Â - Add iHUB Action to save the INC number in the JIRA issue.
To add the INC number to the issue we will need to create a new Action that has the Create Incident action as parent.Â
When doing so the response from the parent will be passed down to the child and can be used for further actions, like this setting the INC number in a custom fields.
Click Create
Select Action and enter a name
Select Template Category: Jira Core Server
Select Template: Edit IssueÂ
Click Create
In the configuration select a authentication user to use when updating the Jira issue (Basic Auth)
In the body section paste the code in below and change the customfield id to match your field.
{
"fields":{"customfield_10201":"{{result.sys_id}}"}
}
The child action will automatically be triggered by its parent.