{
  "key": "io.toolsplus.atlassian.connect.jira.intercom.staging",
  "name": "Intercom for Jira",
  "description": "Intercom integration for Jira",
  "apiVersion": 1,
  "enableLicensing": true,
  "vendor": {
    "name": "ToolsPlus",
    "url": "http://www.toolsplus.io"
  },
  "baseUrl": "https://intercom-for-jira-staging.toolsplus.app",
  "links": {
    "documentation": "https://docs.toolsplus.io/intercom-for-jira"
  },
  "authentication": {
    "type": "jwt"
  },
  "lifecycle": {
    "installed": "/installed",
    "uninstalled": "/uninstalled"
  },
  "scopes": [
    "READ",
    "PROJECT_ADMIN"
  ],
  "apiMigrations": {
    "gdpr": true,
    "context-qsh": true,
    "signed-install": true
  },
  "modules": {
    "jiraEntityProperties": [
      {
        "name": {
          "value": "Intercom Connection Configuration",
          "i18n": "intercom.connection.configuration"
        },
        "key": "connection-configuration-property",
        "entityType": "project",
        "keyConfigurations": [
          {
            "propertyKey": "intercom.connection.configuration",
            "extractions": [
              {
                "objectName": "conversationLinking.enabled",
                "type": "string",
                "alias": "conversationLinkingEnabled"
              }
            ]
          }
        ]
      },
      {
        "name": {
          "value": "Linked Intercom Conversations",
          "i18n": "intercom.conversation.links"
        },
        "key": "conversation-links-property",
        "entityType": "issue",
        "keyConfigurations": [
          {
            "propertyKey": "intercom.conversation.links",
            "extractions": [
              {
                "objectName": "count",
                "type": "number",
                "alias": "linkedIntercomConversationCount"
              },
              {
                "objectName": "conversationIds",
                "type": "string",
                "alias": "linkedIntercomConversationId"
              }
            ]
          }
        ]
      }
    ],
    "jiraIssueFields": [
      {
        "description": {
          "value": "Shows the number of linked Intercom conversations"
        },
        "name": {
          "value": "Number of linked Intercom conversations"
        },
        "type": "read_only",
        "property": {
          "path": "count",
          "key": "intercom.conversation.links",
          "type": "number"
        },
        "key": "intercom-conversation-link-count"
      },
      {
        "description": {
          "value": "Shows linked Intercom conversations ids"
        },
        "name": {
          "value": "Linked Intercom conversation ids"
        },
        "type": "read_only",
        "property": {
          "path": "conversationIds",
          "key": "intercom.conversation.links",
          "type": "string"
        },
        "key": "intercom-conversation-link-ids"
      }
    ],
    "webPanels": [
      {
        "key": "intercom-issue-panel",
        "url": "/issue/panel?issue.id={issue.id}&issue.key={issue.key}&project.id={project.id}&project.key={project.key}",
        "location": "atl.jira.view.issue.right.context",
        "weight": 100,
        "name": {
          "value": "Linked Intercom conversations"
        },
        "conditions": [
          
            {
              "condition": "addon_is_licensed"
            },
          
          {
            "condition": "user_is_logged_in"
          },
          {
            "condition": "entity_property_equal_to",
            "params": {
              "entity": "project",
              "propertyKey": "intercom.connection.configuration",
              "objectName": "intercomIssuePanel.enabled",
              "value": "true"
            }
          },
          {
            "condition": "entity_property_exists",
            "params": {
              "entity": "project",
              "propertyKey": "intercomIntegrationStatus"
            }
          }
        ]
      }
    ],
    "jiraIssueContexts": [
      {
        "key": "issue-glance-intercom-conversation-links",
        "jiraNativeAppsEnabled": true,
        "icon": {
          "width": 24,
          "height": 24,
          "url": "/assets/img/intercom.svg"
        },
        "content": {
          "type": "label",
          "label": {
            "value": "Linked conversations"
          }
        },
        "target": {
          "type": "web_panel",
          "url": "/issue/panel?issue.id={issue.id}&issue.key={issue.key}&project.id={project.id}&project.key={project.key}"
        },
        "name": {
          "value": "Intercom"
        },
        "conditions": [
          
            {
              "condition": "addon_is_licensed"
            },
          
          {
            "condition": "user_is_logged_in"
          },
          {
            "condition": "entity_property_equal_to",
            "params": {
              "entity": "project",
              "propertyKey": "intercom.connection.configuration",
              "objectName": "intercomIssuePanel.enabled",
              "value": "true"
            }
          },
          {
            "condition": "entity_property_exists",
            "params": {
            "entity": "project",
              "propertyKey": "intercomIntegrationStatus"
            }
          }
        ]
      }
    ],
    "jiraProjectAdminTabPanels": [
      {
        "key": "project-configuration",
        "url": "/project/settings?project.key={project.key}&project.id={project.id}&project.isServiceDesk={condition.project_type(projectTypeKey=service_desk)}",
        "location": "projectgroup4",
        "name": {
          "value": "Intercom integration"
        },
        "conditions": [
          
            {
              "condition": "addon_is_licensed"
            }
          
        ]
      }
    ],
    "serviceDeskPortalRequestViewPanels": [
      {
        "key": "sd-portal-request-view-panel-intercom-conversation-links",
        "url": "/servicedesk/portal/request/view/conversation/panel?issue.id={issue.id}&project.id={project.id}&project.key={project.key}",
        "conditions": [
          
            {
              "condition": "addon_is_licensed"
            },
          
          {
            "condition": "user_is_logged_in"
          },
          {
            "condition": "entity_property_equal_to",
            "params": {
              "entity": "project",
              "propertyKey": "intercom.connection.configuration",
              "objectName": "conversationLinking.serviceDeskRequestViewEnabled",
              "value": "true"
            }
          },
          {
            "condition": "entity_property_exists",
            "params": {
              "entity": "project",
              "propertyKey": "intercomIntegrationStatus"
            }
          }
        ]
      }
    ],
    "generalPages": [
      {
        "key": "conversation-details-dialog",
        "url": "/issue/conversation/dialog/details",
        "location": "none",
        "name": {
          "value": "Intercom Conversation Dialog"
        },
        "conditions": [
          
            {
              "condition": "addon_is_licensed"
            },
          
          {
            "condition": "user_is_logged_in"
          }
        ]
      }
    ],
    "postInstallPage": {
      "key": "post-install-instructions",
      "location": "none",
      "name": {
        "value": "Post Install Instructions"
      },
      "url": "/post_install",
      "cacheable": true
    },
    "webhooks": [
      {
        "event": "jira:issue_updated",
        "filter": "project.conversationLinkingEnabled = 'true'",
        "url": "/webhook/issue/updated?projectId=${project.id}",
        "propertyKeys": [
          "intercom.conversation.links"
        ]
      },
      {
        "event": "comment_created",
        "filter": "project.conversationLinkingEnabled = 'true'",
        "url": "/webhook/comment/created?projectId=${project.id}"
      },
      {
        "event": "comment_updated",
        "filter": "project.conversationLinkingEnabled = 'true'",
        "url": "/webhook/comment/updated?projectId=${project.id}"
      }
    ],
    "jiraWorkflowPostFunctions": [
      {
        "key": "intercom-for-jira-wpf-conversation-notify",
        "name": {
          "value": "Notify Intercom conversations"
        },
        "description": {
          "value": "Notifies linked Intercom conversations and optionally reopens closed conversations."
        },
        "triggered": {
          "url": "/wpf/conversation/notify/triggered"
        },
        "view": {
          "url": "/wpf/conversation/notify?action=view&postFunction.id=${postFunction.id}&postFunction.config={postFunction.config}"
        },
        "create": {
          "url": "/wpf/conversation/notify?action=create"
        },
        "edit": {
          "url": "/wpf/conversation/notify?action=edit&postFunction.id=${postFunction.id}&postFunction.config={postFunction.config}"
        }
      }
    ]
  }
}
