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

    • 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?

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

          Max Kaskevich added a comment -

          Have the same issue with "The 'permissions' query parameter is required."

          jenkins 2.190.3(docker image)
          Jira plugin 3.0.11

          Max Kaskevich added a comment - Have the same issue with "The 'permissions' query parameter is required." jenkins 2.190.3(docker image) Jira plugin 3.0.11

          Morgan Nelson added a comment -

          Having the same issue.  I agree with the original poster's assessment, Atlassian changed the API in a breaking way.

          jenkins 2.190.3
          Jira plugin 3.0.11

          Thanks!
           

          Morgan Nelson added a comment - Having the same issue.  I agree with the original poster's assessment, Atlassian changed the API in a breaking way. jenkins 2.190.3 Jira plugin 3.0.11 Thanks!  

          Joseph Magly added a comment - - edited

          Seeing the same issue, has been broken since October at least. 

           

          Jenkins 2.190.3 (deployed to Windows server 2016)

          Jira Plugin 3.0.11

           

          Thank you

          Joseph Magly added a comment - - edited Seeing the same issue, has been broken since October at least.    Jenkins 2.190.3 (deployed to Windows server 2016) Jira Plugin 3.0.11   Thank you

          Calin Caliman added a comment -

          Same issue here.

           

          Jenkins 2.206 (deployed on CentOS)

          Jira Plugin 3.0.11

           

          Thanks.

          Calin Caliman added a comment - Same issue here.   Jenkins 2.206 (deployed on CentOS) Jira Plugin 3.0.11   Thanks.

          benoit guerin added a comment -

          Duplicates of JENKINS-56987 I think

          benoit guerin added a comment - Duplicates of  JENKINS-56987 I think

          Jay Bennett added a comment -

          Just adding my voice that this issue is present in my company's Jenkins integration now, identical error message - awaiting the fix

          Jay Bennett added a comment - Just adding my voice that this issue is present in my company's Jenkins integration now, identical error message - awaiting the fix

          This seems to be fixed in JIRA Plugin 3.0.12

          Craig Rodrigues added a comment - This seems to be fixed in JIRA Plugin 3.0.12

          Ashok T R added a comment -

          Hi everyone, i am getting "org.codehaus.jettison.json.JSONException: JSONObject["name"] not found" error when updating the Jira(Cloud) issue status from jenkins(version 2.204.2). I am using Jira plugin (version 3.0.12). Kindly help me to resolve this issue.

          Ashok T R added a comment - Hi everyone, i am getting "org.codehaus.jettison.json.JSONException: JSONObject ["name"] not found" error when updating the Jira(Cloud) issue status from jenkins(version 2.204.2). I am using Jira plugin (version 3.0.12). Kindly help me to resolve this issue.

          Ashok T R added a comment - - edited

          Hi, is this issue fixed in 3.0.12 version? , we are waiting for this fix , automation process is stopped due to this issue.

          Ashok T R added a comment - - edited Hi, is this issue fixed in 3.0.12 version? , we are waiting for this fix , automation process is stopped due to this issue.

          ashok_t_r You need fixes from https://github.com/jenkinsci/jira-plugin/pull/213 .
          Can you build the jira plugin from this branch by doing:

          git clone -b jira-rest-client.version_5.2.0 https://github.com/rodrigc/jira-plugin
          cd jira-plugin
          mvn clean package -DskipTests
          

          Then install the jira.hpi on your Jenkins server.

          Craig Rodrigues added a comment - ashok_t_r You need fixes from https://github.com/jenkinsci/jira-plugin/pull/213 . Can you build the jira plugin from this branch by doing: git clone -b jira-rest-client.version_5.2.0 https://github.com/rodrigc/jira-plugin cd jira-plugin mvn clean package -DskipTests Then install the jira.hpi on your Jenkins server.

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

              Created:
              Updated:
              Resolved: