Introduction
JIRA is used for bug tracking, issue tracking, and project management.
Note
This collaboration integration supports the webhook-based inbound calls with different types of service management requests. For example, you can select one or multiple Entity Types from Incident, Service Request, Problem, and Change.OpsRamp configuration
Configuration involves:
- Installing integration
- Configuring the integration
Step 1: Install the integration
To install:
- From All Clients, select a client.
- Go to Setup > Integrations > Integrations.
- From Available Integrations, select Collaboration > JIRA.
- Click Install.
Step 2: Configure the integration
Configure the following:
- Inbound
- Outbound
- Monitoring of Integration
- Audit Logs
Inbound
To configure the integration:
In Authentication, configure the authentication to call Freshservice APIs.
- Select Webhook as Authentication Type.
- Select an Entity Type.
- Click Save.
Note: Copy URL details. These values are used for creating and updating tickets in JIRA.
In Map Attributes, map Freshservice attributes with OpsRamp entity attributes.
- Select the OpsRamp entity from the drop-down menu.
- Click Map against the respective attribute, provide the mapping details, and click Save.
The following table shows the attribute mappings:
Third-Party Entity | OpsRamp Entity | Third-Party Property | OpsRamp Property | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Issue | Incident | issue.fields.summary | Subject | ||||||||||||
Issue | Incident | issue.fields.description | Description | ||||||||||||
Issue | Incident | For worklogs: worklog.comment For Comments on Issue: comment.body | Latest comment description | ||||||||||||
Issue | Incident | issue.fields.priority.name
| Priority | ||||||||||||
Issue | Incident | issue.fields.status.name
| Status |
Notes
- You can modify the attributes at any time.
- You need not follow the same mappings.
Create Issue Payload sample sent from Jira
{
"timestamp": 1584872075428,
"webhookEvent": "jira:issue_created",
"issue_event_type_name": "issue_created",
"issue": {
"id": "10000",
"self": "https://test-jira-opsramp.atlassian.net/rest/api/2/10000",
"key": "TEST-1",
"fields": {
"issuetype": {
"self": "https://test-jira-opsramp.atlassian.net/rest/api/2/issuetype/10001",
"id": "10001",
"description": "Functionality or a feature expressed as a user goal.",
"iconUrl": "https://test-jira-opsramp.atlassian.net/secure/viewavatar?size=medium&avatarId=10315&avatarType=issuetype",
"name": "Story",
"subtask": false,
"avatarId": 10315
},
"timespent": null,
"project": {
"self": "https://test-jira-opsramp.atlassian.net/rest/api/2/project/10000",
"id": "10000",
"key": "TEST",
"name": "test",
"projectTypeKey": "software",
"simplified": false
},
"priority": {
"self": "https://test-jira-opsramp.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://test-jira-opsramp.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
},
"customfield_10023": null,
"status": {
"self": "https://test-jira-opsramp.atlassian.net/rest/api/2/status/10000",
"description": "",
"iconUrl": "https://test-jira-opsramp.atlassian.net/",
"name": "To Do",
"id": "10000",
"statusCategory": {
"self": "https://test-jira-opsramp.atlassian.net/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "New"
}
},
"components": [],
"timeoriginalestimate": null,
"description": "test"
}
}
}
Worklog
{
"timestamp":1584872198443,
"webhookEvent":"worklog_created",
"worklog":{
"self":"https://test-jira-opsramp.atlassian.net/rest/api/2/issue/10000/worklog/10000",
"author":{
"self":"https://test-jira-opsramp.atlassian.net/rest/api/2/user?accountId=5dd517ec9def2a0ee974d920",
"accountId":"5dd517ec9def2a0ee974d920",
"displayName":"<name>",
"active":true,
"timeZone":"Asia/Calcutta",
"accountType":"atlassian"
},
"updateAuthor":{
"displayName":"<name>",
},
"comment":"test",
"id":"10000",
"issueId":"10000"
}
}
Outbound
To send entities from OpsRamp to JIRA:
- In Integration Basic Configuration, configure notification details to trigger integration events.
- Notification Type: REST API
- BASE URI:
https://{subdomain}.com/rest/api/2/issue/
- Authentication Type: BASIC
- Provide username and password and then click Save.
Note: For JIRA cloud, using password is deprecated in REST API calls. Create an API token from the Atlassian account and use it as the password. To create the token,- Log into https://id.atlassian.com/manage/api-tokens.
- Click Create API token.
- In Map Attributes, map OpsRamp entity attributes with JIRA attributes.
- Select the attribute, click Map, and Create Integration Mapping window appears.
- Provide the values and then click Save.
- In Integration Events, specify the event. An action performed on an entity is defined as an event.
When an event is triggered, notifications are sent to the respective users.
- Click Add and Add Integration Event page appears.
- Provide a name for the integration event.
- Select Service Desk, select an entity and then select the action.
- Select Parent Configuration to assign basic integration configuration details to the event.
- Select the web method and provide the header name and value.
- Provide the payload for the respective action.
- A custom field that is already configured as a response payload attribute for a given integration is not available for configuration in any other integrations. You need to remove the existing mapping from the integration to make the custom field available to map on the response payload of any other integration.
- To add more tokens to the payload, click the token in the Place Holder list.
- To parse the properties returned in the response, select the property from the drop-down and provide the value.
For example, To parse issue key$key
of JIRA with OpsRamp, select the property as EXT_ENTITY_ID (external entity ID) in OpsRamp.
- Verify Integration, validate if the integration is successful.
- Select the event from the drop-down and then select the payload type.
- Provide the payload values and then click Verify.
- For Integration Failures, select the notification type Email, provide the email address, and click Save.
Integration event payloads
Fields | Values |
---|---|
Endpoint URL | https://{subdomain}.com/helpdesk/tickets |
Headers |
|
Method | POST |
Authentication type | BASIC |
Username | JIRA username |
Password | JIRA password |
Request with hard-coded values
{
"fields" : {
"project" : {
"key" : "IT"
},
"summary" : "Test ticket from OpsRamp integration REST API plugin",
"description" : "Creating of an issue using OpsRamp integration REST API plugin",
"issuetype" : {
"name" : "Bug"
},
"priority" : {
"name" : "Critical"
},
"components" : [
{
"name" : "Component-1"
}
]
}
}
Request with event tokens
{
"fields" : {
"project" : {
"key" : "IT"
},
"summary" : "$incident.subject",
"description" : "$incident.impact",
"issuetype" : {
"name" : "$incident.customFields.clientCustomFieldValues.values_1_25.value_1"
},
"priority" : {
"name" : "[@$incident.priority.name@]"
},
"components" : [
{
"name" : "$incident.customFields.clientCustomFieldValues.values_1_25.value_2"
}
]
}
}
Response
{
"id" : "27999",
"key" : "IT-1",
"self" : "https://jira.opsramp.net:443/rest/api/2/issue/27999"
}
Update JIRA issue
Fields | Values |
---|---|
Endpoint URL |
|
Headers |
|
Method | POST |
Authentication Type | BASIC |
Username | JIRA username |
Password | JIRA password |
Request with event tokens
{
"fields" : {
"priority" : {
"name" : "[@$incident.priority.name@]"
}
}
}
Response
Status code 204 No Content is displayed.
Add comment to JIRA issue
The following parameters provide values for adding comments to a JIRA issue.
Fields | Values |
---|---|
Endpoint URL |
|
Headers |
|
Method | POST |
Authentication Type | BASIC |
Username | JIRA username |
Password | JIRA password |
Request with hard-coded values
{
"body" : "Test comment added"
}
Response
Status code 201 is displayed.
Configuration in JIRA
Configure JIRA to add the webhook URL copied during OpsRamo configuration. To configure,
- Log into JIRA.
- Navigate to Settings, System WebHooks.
- Configure the New Webhook Listener with the Webhook Url generated during OpsRamp configuration and click Save.
Note: If no external ticket ID Mappings are provided, add &extTicketId=${issue.id} at the end of webhook URL copied from OpsRamp.
Example of URL: https://opsramp.com/integrations/incidentWebhook/client_4/incidents?vtoken=Zj8MYUDD8BQhMEstAMxhvPXq5deyNwTV&extTicketId=${issue.id}