cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA event capture in real time via WebHooks and triggering Snaplogic pipelines

ssanikop
Former Employee

Jira event capture in real time via WebHook and trigger Snaplogic pipeline

How to Trigger Snaplogic Pipeline after an event in Jira

This document shows how to setup a Jira instance to trigger a Snaplogic Pipeline (REST API) after an event in Jira and send the event information to Snaplogic pipeline. The events can be one of the following:
• Issue related events
• Project related events
• User related events
• JIRA configuration related events
• JIRA Software related events

Integration Scenario: Update ServiceNow ticket when an Issue is updated in Jira

Steps involved in this integration are:
• Create a SnapLogic pipeline and publish it as a triggered task
• Create a WebHook in Jira to trigger a SnapLogic pipeline after an issue is updated in Jira

Step1: Create a Snaplogic pipeline and publish it as a triggered task

The diagram below is a screen shot of SnapLogic pipeline that consumes the json document sent by Jira after an event (Example: Issue update, like add comments) happens in Jira and updates corresponding ServiceNow ticket.

c1dd729a5d8116c28727b48b619121147794aae6.jpg

The Binary Router Snap receives the incoming json from Jira and sends the output to two flows.

In the first flow, the incoming json document in binary format is parsed and converted to document format, mapper is used to map Jira issue information to appropriate fields in Service Now and “ServiceNow Update Snap” is used to update ServiceNow ticket.

In the second flow, the json received from Jira is written to an audit file.

A section of the json document received is below.
{
“timestamp”: 1483558289780,
“webhookEvent”: “comment_created”,
“comment”: {
“self”: “https://snaplogic.atlassian.net/rest/api/2/issue/25701/comment/21801”,
“id”: “21801”,
“author”: {
“self”: “https://snaplogic.atlassian.net/rest/api/2/user?username=admin”,
“name”: “admin”,
“key”: “admin”,



“created”: “2017-01-04T11:31:29.780-0800”,
“updated”: “2017-01-04T11:31:29.780-0800”
}
}

The following is a triggered task REST API created by Snaplogic for the integration scenario and we will use this to configure WebHook in Jira.

https://elastic.snaplogic.com:443/api/1/rest/slsched/feed/ConnectFasterInc/Shankar%20Sanikop/Service...?

Step2: Create a WebHook in Jira to trigger a Snaplogic pipeline after an issue is updated in Jira

In Jira go to Applications.

aa9eaccc6ccf8c6899b54f612cefc7bfbffec4db.jpg

You will see WebHooks in Advanced Configuration

d3467df7a16103cd75698eff2edfcb8aaabc93e5.jpg

Create a new WebHook to call the Snaplogic Triggered task

In the URL configuration: Put the Snaplogic Triggered task, including the authorization information (bearer_token)
https://elastic.snaplogic.com:443/api/1/rest/slsched/feed/ConnectFasterInc/Shankar%20Sanikop/Service...

f6f30ec4f8165583315ae37adf8b1243da7a7f0d.jpg

Configure the event related information, in this integration we are capturing the issue related events. The diagram below shows the available events of an issue that can be captured and also you can write a JQL query send events only that match certain conditions.

ca4e87c57f9055eda83263e7acfb63ae33e664e3.jpgstrong text

1 REPLY 1

anayak
New Contributor III

Can you please share the conditions you are using in Binary Router as I can’t get the response-content which happens to be a .bin file as seen in the debug trace.