# Unable to create jira issue in watcher action

**URL:** <https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318>\
**Category:** Elasticsearch\
**Created:** [January 12, 2017, 5:54am UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318 "2017-01-12T05:54:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ady](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ady](https://discuss.elastic.co/u/ady)\
**Post date:** [January 12, 2017, 5:54am UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/1 "2017-01-12T05:54:18Z")

</div>

I am going post only action part of my watch here. For the same watch am able to create email notification but not able to create jira notification.

"actions" : {  
"create-jira-issue" : {  
"jira" : {  
"account" : "abc@xyz.com",  
"issue" : {  
"project" : {  
"key": "MYTEST"  
},  
"issuetype" : {  
"name": "Bug"  
},  
"summary" : "Encountered {{ctx.payload.hits.total}} errors in the last 5 minutes",  
"description" : "Encountered {{ctx.payload.hits.total}} errors in the last 5 minutes (facepalm)",  
"labels" : ["auto"],  
"priority" : {  
"name" : "High"  
}  
}  
}  
}  
}

Error is:  
{  
"error": {  
"root\_cause": [  
{  
"type": "parse\_exception",  
"reason": "failed to parse [jira] action [error-watch/create-jira-issue]. unexpected token [START\_OBJECT/issue]"  
}  
],  
"type": "parse\_exception",  
"reason": "failed to parse [jira] action [error-watch/create-jira-issue]. unexpected token [START\_OBJECT/issue]"  
},  
"status": 400  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 12, 2017, 8:15am UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/2 "2017-01-12T08:15:26Z")

</div>

Hey,

can you please try to format your messages appropriately instead of just pasting them here? This makes them much easier to read. See [the markdown docs](http://commonmark.org/help/) to get easily good results.

On to the issue. This looks like a glitch in our docs. Can you try to wrap the jira fields in its own `fields` tag and see if that works? If it does I'll update the docs.

```auto
"actions" : {
  "create-jira-issue" : {
    "jira" : {
      "account" : "abc@xyz.com", 
      "fields" : {
        "issue" : {
        ...
        }
      }
    }

```

--Alex

---

<div class="post-metadata">

**Author:** ![ady](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ady](https://discuss.elastic.co/u/ady)\
**Post date:** [January 12, 2017, 9:35am UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/3 "2017-01-12T09:35:03Z")

</div>

Sorry for the improper format. On wrapping up jira elements inside fields tag overcome the problem. This works for me. Thanks for response.

---

<div class="post-metadata">

**Author:** ![ady](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ady](https://discuss.elastic.co/u/ady)\
**Post date:** [January 12, 2017, 11:16am UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/4 "2017-01-12T11:16:43Z")

</div>

Hey, watch is implemented successful but jira action execution fails i.e. "successful": false. The same use case is working with email action, stats shows:

```
            "last_execution": {
              "reason": "",
              "timestamp": "2017-01-12T10:34:26.905Z",
              "successful": false

```

Jira configuration in elasticsearch.yml is according to the documentation. I am not getting things properly from documentation. Is any configuration change required from jira side also. Please also clarify what account :monitoring is.

xpack.notification.jira:  
account:  
monitoring:  
url: [https://internal-jira.elastic.co:443](https://internal-jira.elastic.co:443)  
user: B0  
password: ms

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 12, 2017, 11:18am UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/5 "2017-01-12T11:18:02Z")

</div>

Hey,

please paste the watch history entry for the last run here for further debugging.

The `account` in your example is just the name of the account, it could also be `anythingelse`. This is just used as an identifier when you add several jira accounts, and you want to specifiy to which jira instance you are sending data in a watch.

--Alex

---

<div class="post-metadata">

**Author:** ![ady](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ady](https://discuss.elastic.co/u/ady)\
**Post date:** [January 12, 2017, 11:34am UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/6 "2017-01-12T11:34:20Z")

</div>

{

"took": 1,

"timed\_out": false,

"\_shards": {

```
"total": 1,

"successful": 1,

"failed": 0

```

},

"hits": {

```
"total": 1,

"max_score": 1,

"hits": [

  {

    "_index": ".watches",

    "_type": "watch",

    "_id": "error1",

    "_score": 1,

    "_source": {

      "trigger": {

        "schedule": {

          "interval": "2m"

        }

      },

      "input": {

        "search": {

          "request": {

            "search_type": "query_then_fetch",

            "indices": [

              "logstash*"

            ],

            "types": [],

            "body": {

              "query": {

                "bool": {

                  "must": [

                    {

                      "match_phrase": {

                        "application_message": " Outgoing status: 200"

                      }

                    }

                  ],

                  "filter": [

                    {

                      "range": {

                        "@timestamp": {

                          "gt": "now-1h"

                        }

                      }

                    }

                  ]

                }

              }

            }

          }

        }

      },

      "condition": {

        "compare": {

          "ctx.payload.hits.total": {

            "gt": 0

          }

        }

      },

      "actions": {

        "create-jira-issue": {

          "jira": {

            "account": "monitoring",

            "fields": {

              "issue": {

                "summary": "Encountered {{ctx.payload.hits.total}} errors in the last 5 minutes",

                "issuetype": {

                  "name": "Bug"

                },

                "project": {

                  "key": "MYTEST"

                },

                "description": "Encountered {{ctx.payload.hits.total}} errors in the last 5 minutes (facepalm)"

              }

            }

          }

        }

      },

      "_status": {

        "state": {

          "active": true,

          "timestamp": "2017-01-12T10:11:51.841Z"

        },

        "actions": {

          "create-jira-issue": {

            "ack": {

              "timestamp": "2017-01-12T10:11:51.841Z",

              "state": "awaits_successful_execution"

            },

            "last_execution": {

              "reason": "",

              "timestamp": "2017-01-12T11:18:26.734Z",

              "successful": false

            }

          }

        },

        "last_checked": "2017-01-12T11:18:26.734Z",

        "last_met_condition": "2017-01-12T11:18:26.734Z"

      }

    }

  }

]

```

}

}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 12, 2017, 5:01pm UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/7 "2017-01-12T17:01:13Z")

</div>

That was the `.watches` I suppose but not the watch history one? You can also just use the [Execute Watch API](https://www.elastic.co/guide/en/x-pack/5.1/watcher-api-execute-watch.html) and paste the output here. Please make sure it's nicely formatted, your posts are not easy to read and make it hard to follow steps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 9, 2017, 5:01pm UTC](https://discuss.elastic.co/t/unable-to-create-jira-issue-in-watcher-action/71318/8 "2017-02-09T17:01:13Z")

</div>

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