Jira rest error 400

400 error when attempting create via rest message

I’ve got ServiceNow sending Rest messages to a base Jira URL with several projects. I’ve got roughly the same REST message working on 4 seperate projects, but the 5th one keeps sending me a generic 400 error.

I’m reasonably certain I’ve ruled out formatting and authentication.
According to the Jira admin, I’m also sending all the mandatory fields and fair values for a couple checklists.

Is there any way to coax Jira for more details on the 400 error?
Is there any place in Jira that this error might be expressed more verbosely?
Are there other ways to make something «Mandatory» other than the database that would also apply to a rest message?

Thanks in advance for your help, community!

2 answers

On that note. is there any place in Jira that can log / analyze incoming rest messages and output/store the response messages? Like if I just launch the rest message and have hte Jira admin simultaneously watching something that could expose the fault?

You must be a registered user to add a comment. If you’ve already registered, sign in. Otherwise, register and sign in.

You could try to turn on access logging in Jira. In the Jira administration page for this, there is a link to have Jira start logging all access requests. On large environments with lots of users, this can create a lot of log entries very quickly. It might not show you all the information you are looking for here, but it might be able to provide some more details about which user is requesting which resources.

I still think that trying to make this call via a command line manually might be able to provide more details about why the request is being rejected.

You must be a registered user to add a comment. If you’ve already registered, sign in. Otherwise, register and sign in.

The HTTP 400 error just means «bad request». It can be difficult to understand why it’s a bad request in some situations like this, because Jira might actually be telling you more about this, but it might not be visible to the other program like ServiceNow.

Читайте также:  Error please make sure unreal engine is running before exporting assets

There are a number of other users that have reported this error and ultimately found a number of different causes for this error. A few examples:

One way I would be interested to try to troubleshoot this would be to try to recreate the REST call yourself via a command line using a utility like curl. REST API calls made with curl are most easily done with basic authentication (username and password), but I think it’s worth testing this in this method, because I think there is a possibility that Jira will provide more information if you still get a 400 error as to why Jira believes this request is invalid. It could be you are tried to update a field that isn’t in the screen, or something like a malformed json request.

Since you can do this for other projects, it might also be beneficial to try to understand how this project is different from those other projects. Is this a Service Desk, Software, or Business project in Jira? Is this Jira Server or Jira Cloud? If Server, what version of Jira server?

Would it be possible to share more details of the REST call being made that is getting rejected? Just curious if we can dig into the details more to better understand what might cause this problem here.

Источник

Receiving Error 400 when creating Issue through Jira REST API , Occurs in Python but not Powershell

I’m encountering a really strange issue with the Jira Rest API.

Whever I try to create an issue using POST request to jira/rest/api/latest/issue/ I receive Error code 400 from Python 2.7 requests but it succeeds from Powershell’s Invoke Web Request.

I’ve tried a number of troubleshooting suggestions from similar topics on this site already:

  • I’ve verified that the Authorisation is correct (it’s also required for the GET requests which all work)
  • I’m testing with an account that has administrator level access to the Jira instance
  • I’ve stripped the json back to just the fields and format matching the REST API documentation here: jira-rest-api-examples/#creating-an-issue-examples
  • I’ve ensured that all the relevant session cookie and header data is stored and added to the follw-up requests
  • I’ve verified through Issue/createmeta that I have the capabilities to create that issue type (and as I pointed out earlier — it works in Powershell)
  • I’ve tried using Issuetype name and id as well as project key and id as the identifier, neither one changes anything
  • I’ve even tried both omitting and including the trailing slash on the /issue path in case that was important

(Formatted for Legibility):

The process flow starts with this class:

from this method:

Which itself calls this class:

I’m getting incredibly frustrated by this, not least because it’s blocking the completion of this migration script and seems to make no sense.

Источник

Jira Software Support

Get started

Knowledge base

Products

Jira Software

Project and issue tracking

Jira Service Management

Service management and customer support

Jira Work Management

Manage any business project

Confluence

Bitbucket

Git code management

Resources

Documentation

Usage and admin help

Community

Answers, support, and inspiration

System Status

Cloud services health

Suggestions and bugs

Feature suggestions and bug reports

Marketplace

Billing and licensing

Frequently asked questions

Viewport

Confluence

Jira Service Management Automation page fails to render with HTTP 400 error

Still need help?

The Atlassian Community is here for you.

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms .

Problem

Automation Page ( /rest/servicedesk/automation/1/ruleset/blueprint/com.atlassian.servicedesk:sd-automation-transition-on-comment-blueprint/project/OS) fails to render in Jira Service Management when using Microsoft IIS.

Diagnosis

Environment

  • Jira 7.3.7 and above (could affect other versions)
  • Reverse Proxy: Microsoft IIS 8.5

Diagnostic Steps

  1. Navigate to Jira Administration » Server » Logging and profiling
    1. Enable HTTP Access Logging
    2. Enable HTTP Dump Logging
  2. Capture a HAR file for the Service Management Automation page that is displaying incorrectly and review it for HTTP 400 errors.

  3. Navigate back to Jira Administration » Server » Logging and profiling
    1. Disable HTTP Dump Logging
    2. Disable HTTP Access Logging
  4. Open up $Jira_HOME /log/atlassian-jira-http-dump.log
    1. Search for plugin:sd-automation and it does not appear in atlassian-jira-http-dump.log
    2. This means that IIS has not let the Browser URL request through to Jira Server

      Additional Diagnostic Steps

      1. Examine the URL with the 400 error and check whether there is a colon (:) character in the URL
      2. Check the Windows Event Viewer on the IIS Server for the following A potentially dangerous Request.Path value was detected from the client error:


      Cause

      Microsoft IIS 8.5/Asp.Net 4.0+ comes with a very strict built-in request validation, part of it is the potential dangerous characters in the url which may be used in XSS attacks. Here are default invalid characters in the url:

      As (:) is part of the exclusion list, IIS does not allow the URL request from the Browser through to Jira Server.

      Источник

      Jira Software Support

      Get started

      Knowledge base

      Products

      Jira Software

      Project and issue tracking

      Jira Service Management

      Service management and customer support

      Jira Work Management

      Manage any business project

      Confluence

      Bitbucket

      Git code management

      Resources

      Documentation

      Usage and admin help

      Community

      Answers, support, and inspiration

      System Status

      Cloud services health

      Suggestions and bugs

      Feature suggestions and bug reports

      Marketplace

      Billing and licensing

      Frequently asked questions

      Viewport

      Confluence

      Jira Service Management Automation page fails to render with HTTP 400 error

      Still need help?

      The Atlassian Community is here for you.

      Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms .

      Problem

      Automation Page ( /rest/servicedesk/automation/1/ruleset/blueprint/com.atlassian.servicedesk:sd-automation-transition-on-comment-blueprint/project/OS) fails to render in Jira Service Management when using Microsoft IIS.

      Diagnosis

      Environment

      • Jira 7.3.7 and above (could affect other versions)
      • Reverse Proxy: Microsoft IIS 8.5

      Diagnostic Steps

      1. Navigate to Jira Administration » Server » Logging and profiling
        1. Enable HTTP Access Logging
        2. Enable HTTP Dump Logging
      2. Capture a HAR file for the Service Management Automation page that is displaying incorrectly and review it for HTTP 400 errors.

      3. Navigate back to Jira Administration » Server » Logging and profiling
        1. Disable HTTP Dump Logging
        2. Disable HTTP Access Logging
      4. Open up $Jira_HOME /log/atlassian-jira-http-dump.log
        1. Search for plugin:sd-automation and it does not appear in atlassian-jira-http-dump.log
        2. This means that IIS has not let the Browser URL request through to Jira Server

          Additional Diagnostic Steps

          1. Examine the URL with the 400 error and check whether there is a colon (:) character in the URL
          2. Check the Windows Event Viewer on the IIS Server for the following A potentially dangerous Request.Path value was detected from the client error:


          Cause

          Microsoft IIS 8.5/Asp.Net 4.0+ comes with a very strict built-in request validation, part of it is the potential dangerous characters in the url which may be used in XSS attacks. Here are default invalid characters in the url:

          As (:) is part of the exclusion list, IIS does not allow the URL request from the Browser through to Jira Server.

          Источник

          Jira REST API Filter getting 400 status and connection close

          AJS.$.ajax
          (<
          url: baseUrl + ‘/rest/api/2/filter/’,
          type: «POST»,
          timeout: 0,
          dataType: ‘json’,
          processData: false,
          headers: <
          «Content-Type»: «application/json; charset=utf-8»,
          «Access-Control-Allow-Origin»: «*»
          >,

          error: function (response)
          <
          console.log(JSON.stringify(response));

          2 answers

          1 accepted

          I see that you are looking to create a filter via rest for Jira, using what looks to be like a javascript style call. The fact that you see a HTTP 400 error tends to indicate that the way the call is being made is incorrect, or there is a bad payload supplied here.

          From the URL in your call, it looks like you’re using either Jira Server or Jira Data Center. Could you please let me know which version of Jira you are using here? I ask because the REST API endpoints have recently changed for a number of server endpoints. For example, in Jira 8.13.0 the endpoint is documented in https://docs.atlassian.com/software/jira/docs/api/REST/8.13.0/#api/2/filter-createFilter as being POST /rest/api/2/filter

          But for 8.21.0 we can see the reference page over in https://docs.atlassian.com/software/jira/docs/api/REST/8.21.0/#filter-createFilter shows that endpoint is now POST /rest/filter

          If you’re on a more recent Jira version, it could be that the endpoint your script is calling is now out of date.

          But if that is not the cause of this problem here, I noticed that the JSON payload looks a bit off to me. The JQL value for example is shown as

          Perhaps my understanding of how javascript will parse this is incorrect, but I expect that if your JQL is something like

          Then we would need to have that equals sign immediately following the project term.

          But even so, if you get this kind of 400 error again, try clicking the Response tab shown in your screenshot. Perhaps the response Jira provides might give us additional hints as to why this call is not working as expected here.

          Источник

Smartadm.ru
Adblock
detector