Issue Integrating Elasticsearch with JIRA REST API

Hello,

Im configuring watcher to create tickets using JIRA rest api. Our JIRA API is not hosted on the default path, and this causes and error in the watcher action. (watcher cannot find the rest api).

The default JIRA path to create tickets is: https://devEnv.com:443/rest/api/2/issue/

Our JIRA path is: https://devEnv.com:443/AppServer/rest/api/2/issue/

I get the following errors when the watcher triggers.

 "reason": "Not Found (account uses invalid JIRA REST APIs) - Exception when parsing jira response [com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@3e456b9b; line: 1, column: 2]]\n",
      "request": {
        "host": "https://devEnv.com",
        "port": 443,
        "scheme": "https",
        "method": "post",
        "path": "/rest/api/2/issue",
        "headers": {
          "Content-Type": "application/json; charset=UTF-8"
        },
        "auth": {
          "basic": {
            "username": "jira_account"
          }
        },

Is there a path variable that can be used to specify the path on this action?

  "actions": {
"create-jira-issue": {
  "throttle_period_in_millis": 3600000,
  "transform": {
    "script": {
      "stored": "transform"
    }
  },
  "jira": {
    "account": "jira_account",
    "fields": {
      "issue": {
        "summary": "Some devices have not sent logs to Elastic",
        "issuetype": {
          "name": "Bug"
        },
        "project": {
          "key": "MON"
        },
        "description": "Device Monitoring: Systems not responding in the last {{ctx.metadata.last_period}} minutes:{{#ctx.payload._value}}{{.}}:{{/ctx.payload._value}}",
        "priority": {
          "name": "High"
        },
        "labels": [
          "auto"
        ]
      }
    }
  }
}

},

Config files looks like this:

    xpack.notification.jira:

account:
monitoring:
url: https://devEnv.com:443
user: jira_account
password: xxxxxxxxxxxxxx
issue_defaults:
project:
key: MON
issuetype:
name: Bug

This is indeed a bug and will be fixed in one of the future versions of Elasticsearch, where we will allow you to specify a concrete URL as endpoint where a JIRA issue gets sent to.

Thanks for your feedback Alex!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.