Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Short guide for integrating Jira Cloud With ServiceNow using iHub Cloud

Create App in ServiceNow

Decide on authentication type, select OAuth2 or JWT.

 OAuth 2 steps
  1. Click All

  2. Type OAuth

  3. Select Application Registry

  4. Click New button

  5. Select “Create an OAuth API endpoint for external clients”

  6. Enter a good name and click Submit


JWT

Setup Credentials in iHub Cloud

OAuth2

  1. Navigate to Credentials

  2. Click Add Credentials

  3. Select OAuth2

  4. Click Save

  5. Select Grant type: Resource Owner Password Credentials Grant

  6. Enter the following fields;

    1.  Authorization Url: <instance-url>/oauth_auth.do

    2.  Username: the integration user

    3. Password: the integration password

    4. Client Id: from Create App in ServiceNow step

    5. Client Secret: from Create App in ServiceNow step

    6. Scope: leave blank

  7. Click Save

Copy the callback URL on the credentials page and go back to the ServiceNow app and paste in the callback and save that.

  1. Click “Click here to Authorize” button

Send Issue data to ServiceNow from Jira Cloud

Create a Incident

  1. Create a new Integration

  2. Set a trigger like Issue Created and provide a simple JQL

  3. Create an Action

  4. Select POST as method

  5. Enter url to your instance example https://dev262540.service-now.com/api/now/v1/table/incident

  6. Select the Authentication created in the above step

  7. Enter the Body

    {
      "short_description": "{{issue.summary}}",
      "description": "{{{toJSON issue.fields.description}}",
      "urgency": 2
    }

Saving ServiceNow incident number on the ticket

  1. Create an Action, select template Update Issue ( this for convenience you may create a empty action and configure it if you like)

  2. Enter a name, like Update issue

  3. Select the custom field that you like to put the incident number into, enter the value "{{result.number}}"

Upload attachments to Incident

ServiceNow attachment API can only receive one file at the time, hence we will iterate over the unsent attachments and send one at the time.

  1. Create an Action

  2. Select the create incident as parent

  3. Select POST as method

  4. Enter url to your instance example https://dev262540.service-now.com/api/now/attachment/upload

  5. Select the Authentication created in the above step

  6. Click Condition, this to prevent this action to be triggered if there is no attachment added and prevent already sent files to be sent.

  7. Define the Condition. Fill in the following details:

    • JSON Path: Enter $.attachments.unsentFile.length

    • Operand: Select "Greater than"

    • Value: 0

  8. Click Advanced tab and enter the iteration path $.issue.fields.attachment to make this action run onetime per attachment found on the ticket.

  9. Enter the Body

    {
        "table_sys_id":"{{result.sys_id}}",
        "table_name":"Incident",
        "file":"{{attachments.unsentFile}}"
    }

  • No labels