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

context specific field not working with jiratestresultreporter-plugin

XMLWordPrintable

      When trying to create an issue from the test report, a JIRA field that is context-related to a different JIRA field couldn't be set.

      Specifically, in the UI our 'create' screen has a few custom required fields.

      Two of these fields have a relationship, we have a field with a text label: "Major Area" and another field with text label "Component", both are dropdown lists of selectable values.

      In the JIRA UI, once I select a value for the "Major Area" field, it changes the various selectable choices for "Component".

      Looking at the html source, these fields have have the following values for name and id:

      "Major Area" – has name and id: "customfield_11100"
      "Component" – has name and id: "customfield_11100:1"

      There are other required fields (without the 'relationship' described above) that also have name/id similar to above, like "customfield_11101" and "customfield_11102", and when I wasn't setting them properly with this plugin, the plugin would show that JIRA was sending a 400 error, complaining that the fields weren't set, and I've now set those properly and those errors have stopped, so I believe I'm configuring the values for this plugin correctly.

      But the context-dependent field "Component" (name/id in the html shows as customfield_11100:1) doesn't want to cooperate. Here's the error I receive from this plugin, when setting that value:

      Error when creating issue
      RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors=

      {customfield_11100:1=Field 'customfield_11100:1' cannot be set. It is not on the appropriate screen, or unknown.}

      , errorMessages=[]}]}

      Here's what my pipeline syntax looks like:

      junit (
      allowEmptyResults: true,
      testResults: 'sampleTestResults/*.xml',
      testDataPublishers: [
      jiraTestResultReporter(
      configs: [
      jiraStringField(fieldKey: 'summary', value: '${DEFAULT_SUMMARY}'),
      jiraStringField(fieldKey: 'description', value: '${DEFAULT_DESCRIPTION}'),
      jiraStringField(fieldKey: 'customfield_11100', value: 'obfuscated'),
      jiraStringField(fieldKey: 'customfield_11100:1', value: 'obfuscated'),
      jiraStringField(fieldKey: 'customfield_11101', value: 'obfuscated'),
      jiraStringField(fieldKey: 'customfield_11102', value: 'obfuscated'),
      ],
      projectKey: 'obfuscated',
      issueType: 'obfuscated',
      autoRaiseIssue: false,
      autoResolveIssue: false,
      autoUnlinkIssue: false,
      )
      ]
      )

            catalinluta Catalin Luta
            borisivan boris ivan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: