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

queryParams ignored for jiraGetFields

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: jira-steps-plugin
    • Labels:
      None
    • Environment:
      Jenkins: 2.190.3
      jira-steps-plugin: 1.5.3
    • Similar Issues:

      Description

      As per https://jenkins.io/doc/pipeline/steps/jira-steps/#jiragetfields-jira-steps-get-fields , `jiraGetFields` should accept `queryParams`, but it is ignored.

      Using below code:

      curl -s -u "${JIRA_USER_EMAIL}:${JIRA_API_KEY}" -H "Content-Type: application/json" "https://${JIRA_HOST}/rest/api/2/issue/createmeta?projectKeys=${JIRA_PROJECT}&issuetypeNames=Bug&expand=projects.issuetypes.fields" | jq '.projects|.[].issuetypes|.[].fields | with_entries({value: .key, key: .value.name})' | grep 'Result'
      

      on:

      1. Default project - yields:
         "Actual Result": "customfield_10540",
         "Expected Result": "customfield_10539",
        
      1. Test project - yields:
         "Actual Result": "customfield_10590",
         "Expected Result": "customfield_10591",
        

      Running below groovy snippet:

       def result = jiraGetFields site: '<SITE>', queryParams: [ projectKeys: '<PROJECT_ID>', issuetypeNames: 'Bug', ]//expand: 'projects.issuetypes.fields' ]
       def field_mapping = result.data.collectEntries {[
       (it.name): it.key
       ]}
       field_mapping.each { key, val ->
         if (key.contains('Result')) {
           println "${key}: ${val}"
         }
       }
      

      On both test and default projects, yields:

      JIRA: Site - <SITE> - Querying All Fields including Custom fields.
      Successful. Code: 200
      [Pipeline] echo
      Actual Result: customfield_10540
      [Pipeline] echo
      Expected Result: customfield_10539
      

        Attachments

          Activity

          Hide
          nrayapati Naresh Rayapati added a comment -
          Show
          nrayapati Naresh Rayapati added a comment - Not implemented yet: https://issues.jenkins-ci.org/browse/JENKINS-60776

            People

            • Assignee:
              nrayapati Naresh Rayapati
              Reporter:
              sbienkow Szymon BieĊ„kowski
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: