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

JIRA steps plugin requires In-process script approval

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: jira-steps-plugin
    • Labels:
      None
    • Environment:
      Jenkins (2.107.2)
      jira-steps-plugin (1.3.1)
    • Similar Issues:

      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

          Hide
          nrayapati Naresh Rayapati added a comment -

          Raul Bejaran 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.

          Show
          nrayapati Naresh Rayapati added a comment - Raul Bejaran 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.
          Hide
          rbejaran_swi Raul Bejaran added a comment -

          Hello Naresh Rayapati,

          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.

          Show
          rbejaran_swi Raul Bejaran added a comment - Hello Naresh Rayapati , 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.
          Hide
          nrayapati Naresh Rayapati added a comment -

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

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

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

          Show
          nrayapati Naresh Rayapati added a comment - Merged above pull request and will release it after further verification.
          Hide
          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.

          Show
          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.
          Hide
          nrayapati Naresh Rayapati added a comment - - edited

          Raul Bejaran 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()
          }
          
          Show
          nrayapati Naresh Rayapati added a comment - - edited Raul Bejaran 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() }
          Hide
          rbejaran_swi Raul Bejaran added a comment -

          Hello Naresh Rayapati,

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

          Show
          rbejaran_swi Raul Bejaran added a comment - Hello Naresh Rayapati , 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

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

              Dates

              • Created:
                Updated:
                Resolved: