Jira is used for bug tracking, issue tracking, and project management.
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
Step 1: Install the integration
- 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
- In Authentication, configure the authentication to call Freshservice APIs.
- Select Webhook as Authentication Type.
- Select an Entity Type.
- Click Save.
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, enter 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 |
- You can change 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
- 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 click Save.
For Jira cloud, using passwords 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 is displayed.
- Enter the values and 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.
Enter a name for the integration event.
Select Service Desk, select an entity and select the action.
Select Parent Configuration to assign basic integration configuration details to the event.
Select the web method and enter the header name and value.
Enter 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 enter the value.
Response: Select a response and enter a value. The event is created, only if you provide the response properties.
Integration response mapping configuration:
Response mapping configuration is mainly based on the response payload that is received in third party payload; below are a few examples for response mapping configuration -- sample response payload to mapping the id in response mapping:
{ "id":"INC0001", "type":"incident", "tool":"servicedesk" }
external ticket id = $id
We need to append $ to the value- sample response payload to mapping the id in response mapping:
{ "result":{ "id":"INC0001", "type":"incident", "tool":"servicedesk" } }
external ticket id = $result.id
- Sample response payload to mapping the id in response mapping
{ "result":[ { "ticketDetails":{ "id":"INC0001", "type":"incident", "tool":"servicedesk" }, "Description":{ "display_value":"testing description", "value":"validating" } } ] }
external ticket id = $result[0].ticketDetails.id
- sample response payload to mapping the Incident Number in response mapping
{ "result": { "Incident Number": "INC0001", "type": "Incident" } }
external ticket id = $result[‘Incident Number’]
Verify integration
To validate if the integration is successful, do the following:
- Select the event from the drop-down menu and select payload type.
- Enter the payload and click Verify. A 200-OK success response is generated if the integration is successful.
Integration failures
In case of a failure in integration, a message is sent to the respective user. Select notification type Email, enter the email address, and click Save.
Monitoring of Integration
Assign a template from the Monitoring of Integration tab, if you want to monitor integration failures. See monitoring integration failures for more information.
Audit Logs
View logs from the Audit Logs tab. You can view if the event was successful or not.
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.
Update Jira issue with attachment
Fields | Values |
---|---|
Endpoint URL |
|
Headers |
|
Method | POST |
Authentication Type | BASIC |
Username | Jira username |
Password | Jira password |
Request with event tokens
{
"file":"$utils.attachmentMultipart($incident.latestResponse.resourceList,$incident.client.uniqueId,$installedAppId,$incident.uniqueId,$incident.latestResponse.id,$entity)"
}
Response
[
{
"self": "https://jira.atlassian.net/rest/api/3/attachment/10000",
"id": "10000",
"filename": "file.txt",
"created": "2021-03-31T09:02:00.991+0530",
"size": 181,
"mimeType": "text/html",
"content": "https://jira.atlassian.net/secure/attachment/10000/file.txt"
}
]
Update Jira issue status
Fields | Values |
---|---|
Endpoint URL |
|
Headers |
|
Method | POST |
Authentication Type | BASIC |
Username | Jira username |
Password | Jira password |
Request with event tokens
{
"transition": {
"id": "[@$incident.status.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.
Jira configuration
Configure Jira to add the webhook URL copied during OpsRamo configuration.
- Log into Jira.
- Navigate to Settings, System WebHooks.
- Configure the New Webhook Listener with the Webhook Url generated during OpsRamp configuration and click Save.
If no external ticket ID Mappings are provided, add &extTicketId=${issue.id} at the end of webhook URL copied from OpsRamp.