Getting 400 from Jira while trying to create an alert from Opsgenie
Asked by Awais Ali:

Hey, I have configured the JIRA and Opsgenie integration. But when it tries to create an issue it returns a 400 from JIRA, any ideas?

```
Could not send [createIssue] action to JiraServiceDesk [JiraServiceDesk - DevOps]. Reason: 400
```

```
{
  "alertLogOwner": "System",
  "responseBody": "{\"errorMessages\":[],\"errors\":{\"issuetype\":\"issue type is required\"}}",
  "_outgoingData": {
    "_headers": {
      "Authorization": "...",
      "-Content-Type": [
        "application/json;charset=UTF-8"
      ]
    },
    "integrationType": "JiraServiceDesk",
    "_payload": {
      "_fields": {
        "summary": "Test Alert from Opsgenie",
        "-labels": [
          "fromOG"
        ],
        "_project": {
          "key": "DEVOPS"
        },
        "_issuetype": {
          "name": "Task"
        },
        "description": "The alert has no description."
      }
    },
    "integrationName": "JiraServiceDesk - DevOps"
  },
  "alertId": "4gh3bsfk9-88b3-555n-9b97-23432b234234-234234234234",
  "alertLogType": "system",
  "statusCode": "BAD_REQUEST"
}
```

I have double-checked the configurations and they are set up correctly though.

![Screen Shot 2020-03-03 at 4.17.31 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/85077i8EDA43527AA94E0C/image-dimensions/806x227?v=v2 "Screen Shot 2020-03-03 at 4.17.31 PM.png")

![Screen Shot 2020-03-03 at 4.19.15 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/85079i35FD518112ACE9AF/image-size/large?v=v2&px=999 "Screen Shot 2020-03-03 at 4.19.15 PM.png")


Answers:
author: Awais Ali
body: I have resolved this by creating a new issue type in Jira with the same name that I am providing in the Issue Type Name field.


author: Samir
body: Hi [@Awais Ali](/t5/user/viewprofilepage/user-id/2367590) - it looks like it's saying there is no issue-type specified. In your Jira integration in Opsgenie, did you specify the issue-type you want the Jira issue to be created with in this field?

![jiraScreen.png](https://community.atlassian.com/t5/image/serverpage/image-id/85284i56A02925AAB1AC14/image-size/large?v=v2&px=999 "jiraScreen.png")

comments: author: Awais Ali
body: Hey [@Samir](/t5/user/viewprofilepage/user-id/2168284),

Thanks for the reply. I am providing the issue type. I have resolved this by creating a new issue type in Jira with the same name that I am providing in the Issue Type Name field.

The opsgenie integration marks the fields shared in the screenshot as mandatory so you have to provide these in order to set the integration up (if you have not checked the oec checkbox)

I was supplying the same issue types that I had in my project in Jira previously as well but I guess there was some access issue that was not causing it to create the issues on Jira. This was all set once I created a new type with no restrictions. Anyways this is good to close now.


author: GlennF
body: [@Awais Ali](/t5/user/viewprofilepage/user-id/2367590) how were you able to get the response JSON from the request? I am seeing similar issues but intermittently. I suspect there are ascii characters in my requests but I can't figure it out since I can't figure out how to get the response JSON.

Thanks in advance!

comments: author: Awais Ali
body: Hey, [@GlennF](/t5/user/viewprofilepage/user-id/3488383) I got this from Opsgenie. If you navigate to

```
yourapp.opsgenie.com/settings/log
```

you will see warn and error level logs. From there you can see what is the response JSON sent from Jira.

You can search on the basis of the alert for which it's causing issues.

Let me know if that is what you want or is there anything else you are looking for


author: GlennF
body: Brilliant! Thanks [@Awais Ali](/t5/user/viewprofilepage/user-id/2367590) \~


Tags: integration

jira

jira-service-desk