Alert High severity JIRA issues through WSO2 ESB JIRA & TWILIO connectors

The below section describes how to configure cloud to cloud integration with WSO2 ESB Connectors using WSO2 Developer Studio.

Scenario:

Query new (open) high severity issues created in JIRA system and alert them by a SMS.

Untitled

The latest version of Developer Studio can be downloaded from [1]

Import connectors

Before you start creating ESB artifacts with connector operation, the necessary connectors should be imported into your workspace. You can download the ESB connectors from [2]

  • Create a  new ESBConfig project (SampleConnectorProject)
  • Right click on the created ‘SampleConnectorProject’ project and select ‘Import Connector’ from the context menu.

image07

  • Then browse the location of the connector zip and select the relevant connectors zip (jira-connector.zip, twilio-connector.zip) to import.
  • Create Sequence, Proxy or REST API and the imported connectors will be appeared in the tool palette.

image08

Create ESB Artifacts with Connector Operations

The detailed configurations on how to perform various operations on Jira Connector and Twilio connector can be found in [3] and [4] respectively.

  • Create a Sequence[5] with name ‘AlertSequence’
  • Connect to Jira

image10

Drag and drop the ‘init’  JIRA operation from the tool palette before use any other Jira connector operations.

This configuration authenticates with Jira system by configuring the user credentials and login url. Provide username and password and url for Jira System.

image11

  • Get high severity issues created.

Drag and drop ‘searchJira’ operation from the tool palette to retrieve data from Jira system.

image01

Set query to get open , highest severity issues in property window.

priority = Highest AND resolution = Unresolved AND status = Open

image00

  • Loop through retrieved issues

Jira system response have following  format.

image03

According to response there are two issues in high priority and open. To loop through them Drop Iterator mediator.


image02

Set ‘Iterate Expression’ property to “//issues”of Iterator mediator.

image04

  • Extract the issue link from iterated issue.

Drop a Property mediator into the iterator. Set values as follows. It will concat issue link and “WSO2 ALERT” message.

image12

  • Connect to Twilio

Drop Twilio Init operation from palette and provide required account details to authenticate.

image13

 

  • Send extracted issue link as a SMS alert

Drop a Twilo sendSMS mediator.
image14

Set ‘To’ value to receiver phone number . (‘From’  value needs to be find in your Twilio account).

Simply place the ‘body’ with property value.

image15

  • It might be useful to add Log mediators for log sequence status intermediately.


image18

  • Triggering sequence in periodically

ESB Scheduled Task component can be use to invoke the sequence we created. Create a Shedule Task[6] name “AlertTask” in same project.

 

In properties, get the ‘Task Properties’ pop-up configuration window. Set ‘sequenceName’  to “AlertSequence” , ‘injectTo’ to “sequence” and ‘message’

image19

In AlertTask properties change ‘interval’ to 900, which is 15 minutes, and ‘count’ to -1 .

Create the deploy archive to deploy in WSO2 ESB

  • Create a Composite Application Project (SampleCAPP) from Developer Studio and include the SampleConnectorProject as Dependencies.

image20

Deploying in WSO2 ESB

  • Download WSO2 ESB 4.8.0 from [7].
  • Install the Connectors (Jira Connector and Twilio Connector)  [8].

After install connectors in ESB server make sure to activate them.

  • Deploy the ‘SampleCAPP’ in Developer Studio[9]

Check issues intermittently by client REST application

This issues review scenario completely time synchronized. If someone needs to check whether are there high priority issues immediately, we should be able to invoke the sequence.

Considering user makes request from REST client.

  • Create REST API artifact in Sample SampleConnectorProject[10]

A REST API allows you to configure REST endpoints in the ESB by directly specifying HTTP verbs (such as POST and GET), URI templates, and URL mappings through an API.

image21

  • Drop AlertSequence into insequence from pallet Defined Sequences section.

image16

Make sure to set value ‘true’ for Continue Parent property in AlertSequence, Iterator mediator.

image17

  • Drop ‘Respond’ mediator. (this will redirect results to user)


image09

Now deploy the  SampleCAPP.  In management console, REST api menu page will show the SampleRESTAPI, and API Invocation URL. Using this url, we can simply check the issues created with high priority intermittently.

image05

[1] http://wso2.com/products/developer-studio/

[2]. https://github.com/wso2/esb-connectors/tree/master/distribution

[3]. http://docs.wso2.org/display/ESB480/JIRA+Connector

[4]. http://docs.wso2.org/display/ESB480/Twilio+Connector

[5].http://docs.wso2.org/display/DVS350/Creating+ESB+Artifacts#CreatingESBArtifacts-Workingwithsequences

[6]http://docs.wso2.org/display/DVS350/Creating+ESB+Artifacts#CreatingESBArtifacts-Creatingascheduledtask

[7] http://wso2.com/products/enterprise-service-bus/

[8] http://docs.wso2.org/display/ESB480/Managing+Connectors+in+Your+ESB+Instance

[9]http://docs.wso2.org/display/DVS350/Deploying+and+Debugging#DeployingandDebugging-DeployingaC-ApptoarunningserverinsideEclipse

[10] http://docs.wso2.org/display/DVS350/Creating+ESB+Artifacts#CreatingESBArtifacts-CreatingaRESTAPI

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s