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

JIRA steps plugin requires In-process script approval

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • jira-steps-plugin
    • None
    • Jenkins (2.107.2)
      jira-steps-plugin (1.3.1)

    Description

      After having installed Jenkins (2.107.2) on my PC with jira-steps-plugin (1.3.1), I noticed that in order to parse the response of JIRA queries (for example jiraJqlSearch), the Jenkins administrator needs to manually approve this method on the "in-process script approvals" page:

      method org.thoughtslive.jenkins.plugins.jira.api.ResponseData getData

      I even tried out one example on the official documentation and the approval is still required: https://jenkinsci.github.io/jira-steps-plugin/getting-started/examples/new_fix_version/

      It would be better if this method was part of the Jenkins default whitelist, or if the plugin installation automatically adds it
      If this cannot be done for some reason, then the official plugin documentation should mention it on the configuration section.

      Thanks.

      Attachments

        Activity

          rbejaran_swi Agree, we could have mentioned it in the docs, would you mind making a pull request for this change? or I will get to it once I have a moment.

          I will have this open to programmatically whitelist the method. Thanks for reporting this issue.

          nrayapati Naresh Rayapati added a comment - rbejaran_swi Agree, we could have mentioned it in the docs, would you mind making a pull request for this change? or I will get to it once I have a moment. I will have this open to programmatically whitelist the method. Thanks for reporting this issue.
          rbejaran_swi Raul Bejaran added a comment -

          Hello nrayapati,

          Sorry but I don't have much time to do the doc change myself. I guess it takes some time to do it the right way (read, undestand then follow workflow and conventions). If there is already an open ticket for adding this on the default whitelist, then I guess it would be OK to just wait for it, hoping it will come soon.

          Thanks for the plugin Naresh.

          Cheers.

          rbejaran_swi Raul Bejaran added a comment - Hello nrayapati , Sorry but I don't have much time to do the doc change myself. I guess it takes some time to do it the right way (read, undestand then follow workflow and conventions). If there is already an open ticket for adding this on the default whitelist, then I guess it would be OK to just wait for it, hoping it will come soon. Thanks for the plugin Naresh. Cheers.

          Made a pull request to whitelist this method: https://github.com/jenkinsci/jira-steps-plugin/pull/74

          nrayapati Naresh Rayapati added a comment - Made a pull request to whitelist this method: https://github.com/jenkinsci/jira-steps-plugin/pull/74

          Merged above pull request and will release it after further verification.

          nrayapati Naresh Rayapati added a comment - Merged above pull request and will release it after further verification.

          Made another one to whitelist rest of the methods on this class: https://github.com/jenkinsci/jira-steps-plugin/pull/76

          Forgot about these earlier.

          nrayapati Naresh Rayapati added a comment - Made another one to whitelist rest of the methods on this class: https://github.com/jenkinsci/jira-steps-plugin/pull/76 Forgot about these earlier.
          nrayapati Naresh Rayapati added a comment - - edited

          rbejaran_swi Thanks for reporting, Merged above pull request too and released the code 1.4.3 and tested code by downloading the jar manually, this should be available in 2-4hrs in upgrade center. Closing this JIRA. Please don't hesitate to reopen this JIRA or log another one if you see any issues with this change. Thank you.

          node {
              def issue = jiraGetIssue idOrKey: 'TEST-1', site: 'localJIRA'
              echo issue.data.toString()  
              echo issue.message.toString()
              echo issue.successful.toString()
              echo issue.code.toString()
              echo issue.error.toString()
          }
          
          nrayapati Naresh Rayapati added a comment - - edited rbejaran_swi Thanks for reporting, Merged above pull request too and released the code 1.4.3 and tested code by downloading the jar manually, this should be available in 2-4hrs in upgrade center. Closing this JIRA. Please don't hesitate to reopen this JIRA or log another one if you see any issues with this change. Thank you. node { def issue = jiraGetIssue idOrKey: 'TEST-1' , site: 'localJIRA' echo issue.data.toString() echo issue.message.toString() echo issue.successful.toString() echo issue.code.toString() echo issue.error.toString() }
          rbejaran_swi Raul Bejaran added a comment -

          Hello nrayapati,

          Thank you very much for this fix. I just tested .data  on plugin v1.4.3 over my local Jenkins and it works perfectly.

          rbejaran_swi Raul Bejaran added a comment - Hello nrayapati , Thank you very much for this fix. I just tested .data   on plugin v1.4.3 over my local Jenkins and it works perfectly.

          People

            nrayapati Naresh Rayapati
            rbejaran_swi Raul Bejaran
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: