Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60305

Jira plugin can't validate credentials due to breaking change in JIRA-- "permissions query parameter" is now required

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • jira-plugin
    • Jenkins ver. 2.190.2 (official Docker image)
      Jira Plugin 3.0.11

      I'm trying to connect Jenkins to my company's cloud-hosted Jira (e.g. https://MYCOMPANY.atlassian.net/).  My account there is set up with google, so based on JIRA Rest API authentication always returns 401 unauthorized I took the step of creating an API token from https://id.atlassian.com/manage/api-tokens

      Using this, I am able to successfully curl my Jira site:

      $ curl -D- -u "me@MYCOMPANY.com:aUthT0K3n" -X GET -H "Content-Type: application/json" https://MYCOMPANY.atlassian.net/rest/api/2/issue/TST-123

      HTTP/2 200

      [...snip...] 

      Adding these credentials to Jenkins credentials manager was no problem.  I specify them for the Jira plugin configuration too.  But when I click "Validate Settings", I receive the following error:

      Failed to login to JIRA

      I can confirm that the proper credentials are being accessed, because when I visit https://id.atlassian.com/manage/api-tokens it says that the API token was used "A few seconds ago". 

      I see this in my Jenkins logs:

      Failed to login to JIRA at https://MYCOMPANY.atlassian.net/ RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[The 'permissions' query parameter is required.]}]}

      I suspect that this is related to this deprecation warning:

      https://community.developer.atlassian.com/t/announcement-changes-to-rest-api-2-mypermissions-get-my-permissions/21245

      Previously, the resource would return all permissions defined on the Jira instance, now the list is limited to the keys provided in the permissions query parameter.

      Not sending the parameter is deprecated, and we are planning to start rejecting such requests starting from 1 February 2019.

      You can find more details here: Change notice - Get my permissions resource now requires the permissions query parameter 

       Is there something obvious that I'm missing or is this a bug in the plugin?

            falcon benoit guerin
            ianfixes Ian Katz
            Votes:
            7 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: