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

          Ian Katz created issue -
          Ian Katz made changes -
          Description Original: I'm trying to connect Jenkins to my company's cloud-hosted Jira (e.g. [https://MYCOMPANY.atlassian.net/).|https://mycompany.atlassian.net/).]  My account there is set up with google, so based on [JIRA Rest API authentication always returns 401 unauthorized|[https://community.atlassian.com/t5/Jira-questions/JIRA-Rest-API-authentication-always-returns-401-unauthorized/qaq-p/187181#M317050]] 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:
          {quote}$ curl -D- -u "me@MYCOMPANY.com:aUthT0K3n" -X GET -H "Content-Type: application/json" [https://MYCOMPANY.atlassian.net/rest/api/2/issue/TST-123|https://mycompany.atlassian.net/rest/api/2/issue/TST-123]

          HTTP/2 200

          [...snip...]{color:#172b4d} {color}
          {quote}
          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:
          {quote}Failed to login to JIRA
          {quote}
          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:
          {quote}{{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.]}]}}}{quote}
          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]
          {quote}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||https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/] [https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/] []|https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/]
          {quote}
           
          New: I'm trying to connect Jenkins to my company's cloud-hosted Jira (e.g. [https://MYCOMPANY.atlassian.net/).|https://mycompany.atlassian.net/).]  My account there is set up with google, so based on [JIRA Rest API authentication always returns 401 unauthorized|#M317050] 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:
          {quote}$ curl -D- -u "me@MYCOMPANY.com:aUthT0K3n" -X GET -H "Content-Type: application/json" [https://MYCOMPANY.atlassian.net/rest/api/2/issue/TST-123|https://mycompany.atlassian.net/rest/api/2/issue/TST-123]

          HTTP/2 200

          [...snip...]{color:#172b4d} {color}
          {quote}
          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:
          {quote}Failed to login to JIRA
          {quote}
          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:
          {quote}{{Failed to login to JIRA at [https://MYCOMPANY.atlassian.net/|https://mycompany.atlassian.net/] RestClientException\{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[The 'permissions' query parameter is required.]}]}}}
          {quote}
          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]
          {quote}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|https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/
          {quote}
           
          Ian Katz made changes -
          Description Original: I'm trying to connect Jenkins to my company's cloud-hosted Jira (e.g. [https://MYCOMPANY.atlassian.net/).|https://mycompany.atlassian.net/).]  My account there is set up with google, so based on [JIRA Rest API authentication always returns 401 unauthorized|#M317050] 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:
          {quote}$ curl -D- -u "me@MYCOMPANY.com:aUthT0K3n" -X GET -H "Content-Type: application/json" [https://MYCOMPANY.atlassian.net/rest/api/2/issue/TST-123|https://mycompany.atlassian.net/rest/api/2/issue/TST-123]

          HTTP/2 200

          [...snip...]{color:#172b4d} {color}
          {quote}
          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:
          {quote}Failed to login to JIRA
          {quote}
          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:
          {quote}{{Failed to login to JIRA at [https://MYCOMPANY.atlassian.net/|https://mycompany.atlassian.net/] RestClientException\{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[The 'permissions' query parameter is required.]}]}}}
          {quote}
          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]
          {quote}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|https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/
          {quote}
           
          New: I'm trying to connect Jenkins to my company's cloud-hosted Jira (e.g. [https://MYCOMPANY.atlassian.net/).|https://mycompany.atlassian.net/).]  My account there is set up with google, so based on [JIRA Rest API authentication always returns 401 unauthorized|#M317050] 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:
          {quote}{{$ curl -D- -u "me@MYCOMPANY.com:aUthT0K3n" -X GET -H "Content-Type: application/json" [https://MYCOMPANY.atlassian.net/rest/api/2/issue/TST-123|https://mycompany.atlassian.net/rest/api/2/issue/TST-123]}}

          HTTP/2 200

          [...snip...]{color:#172b4d} {color}
          {quote}
          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:
          {quote}Failed to login to JIRA
          {quote}
          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:
          {quote}Failed to login to JIRA at [https://MYCOMPANY.atlassian.net/|https://mycompany.atlassian.net/] RestClientException{{\{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[The 'permissions' query parameter is required.]}]}}}
          {quote}
          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]
          {quote}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|https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/
          {quote}
           
          Ian Katz made changes -
          Description Original: I'm trying to connect Jenkins to my company's cloud-hosted Jira (e.g. [https://MYCOMPANY.atlassian.net/).|https://mycompany.atlassian.net/).]  My account there is set up with google, so based on [JIRA Rest API authentication always returns 401 unauthorized|#M317050] 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:
          {quote}{{$ curl -D- -u "me@MYCOMPANY.com:aUthT0K3n" -X GET -H "Content-Type: application/json" [https://MYCOMPANY.atlassian.net/rest/api/2/issue/TST-123|https://mycompany.atlassian.net/rest/api/2/issue/TST-123]}}

          HTTP/2 200

          [...snip...]{color:#172b4d} {color}
          {quote}
          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:
          {quote}Failed to login to JIRA
          {quote}
          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:
          {quote}Failed to login to JIRA at [https://MYCOMPANY.atlassian.net/|https://mycompany.atlassian.net/] RestClientException{{\{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[The 'permissions' query parameter is required.]}]}}}
          {quote}
          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]
          {quote}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|https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/
          {quote}
           
          New: I'm trying to connect Jenkins to my company's cloud-hosted Jira (e.g. [https://MYCOMPANY.atlassian.net/).|https://mycompany.atlassian.net/).]  My account there is set up with google, so based on [JIRA Rest API authentication always returns 401 unauthorized|#M317050] 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:
          {quote}
          {code}
          $ curl -D- -u "me@MYCOMPANY.com:aUthT0K3n" -X GET -H "Content-Type: application/json" https://MYCOMPANY.atlassian.net/rest/api/2/issue/TST-123{code}
          HTTP/2 200

          [...snip...]{color:#172b4d} {color}
          {quote}
          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:
          {quote}Failed to login to JIRA
          {quote}
          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:
          {quote}Failed to login to JIRA at [https://MYCOMPANY.atlassian.net/|https://mycompany.atlassian.net/] RestClientException{{{statusCode=Optional.of(400), errorCollections=[ErrorCollection\{status=400, errors={}, errorMessages=[The 'permissions' query parameter is required.]}]}}}
          {quote}
          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]
          {quote}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|https://developer.atlassian.com/cloud/jira/platform/change-notice-get-my-permissions-requires-permissions-query-parameter/
          {quote}
           Is there something obvious that I'm missing or is this a bug in the plugin?

          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 made changes -
          Link New: This issue relates to JENKINS-56987 [ JENKINS-56987 ]

          benoit guerin added a comment -

          Duplicates of JENKINS-56987 I think

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

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

              Created:
              Updated:
              Resolved: