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

Cannot update JIRA custom field through jira-ext plugin

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • jira-ext-plugin
    • None

      I'm using the jira-ext plugin for jenkins, and try to update custom fields (in JIRA) of type Label and User Picker (single user) as part of my build. The update fails on the Label update stating:

      net.rcarz.jiraclient.JiraException: Field expects an Iterable value
      

      And on the User Picker, error:

      net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"customfield_10100":"data was not an object"}}
      

      The configuration I use to update both is attached as a screenshot.

      What is the correct format to update such custom fields through this plugin? I tried matching the JIRA REST API documentation but probably didn't get that exactly.

          [JENKINS-36811] Cannot update JIRA custom field through jira-ext plugin

          Oren Schor created issue -

          Dan Alvizu added a comment -

          Is the field you are updating a multi-select field? If so I don't think that's supported yet in jira-ext plugin.

          There's a way to select it in the svc but this is not exposed in the UI, it will need to be implemented:

          https://github.com/jenkinsci/jira-ext-plugin/commit/5169f766c3300a37832f6c3db63d2f4fc1069602

          Dan Alvizu added a comment - Is the field you are updating a multi-select field? If so I don't think that's supported yet in jira-ext plugin. There's a way to select it in the svc but this is not exposed in the UI, it will need to be implemented: https://github.com/jenkinsci/jira-ext-plugin/commit/5169f766c3300a37832f6c3db63d2f4fc1069602

          Oren Schor added a comment - - edited

          dalvizu There are 2 fields I'm trying to update:
          1. Label field (which can contain more than one value)
          2. User Picker (single user) field which can contain only 1 value.

          Is the update of these 2 fields supported?

          Oren Schor added a comment - - edited dalvizu There are 2 fields I'm trying to update: 1. Label field (which can contain more than one value) 2. User Picker (single user) field which can contain only 1 value. Is the update of these 2 fields supported?
          Oren Schor made changes -
          Description Original: I'm using the jira-ext plugin for jenkins, and try to update custom fields (in JIRA) of type Label and User Picker (single user) as part of my build. The update fails on the Label update stating:

          net.rcarz.jiraclient.JiraException: Field expects an Iterable value
          And on the User Picker, error:

          net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"customfield_10100":"data was not an object"}}

          The configuration I use to update both is attached as a screenshot.

          What is the correct format to update such custom fields through this plugin? I tried matching the JIRA REST API documentation but probably didn't get that exactly.
          New: I'm using the jira-ext plugin for jenkins, and try to update custom fields (in JIRA) of type Label and User Picker (single user) as part of my build. The update fails on the Label update stating:

          {code}
          net.rcarz.jiraclient.JiraException: Field expects an Iterable value
          {code}

          And on the User Picker, error:

          net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"customfield_10100":"data was not an object"}}

          The configuration I use to update both is attached as a screenshot.

          What is the correct format to update such custom fields through this plugin? I tried matching the JIRA REST API documentation but probably didn't get that exactly.
          Oren Schor made changes -
          Description Original: I'm using the jira-ext plugin for jenkins, and try to update custom fields (in JIRA) of type Label and User Picker (single user) as part of my build. The update fails on the Label update stating:

          {code}
          net.rcarz.jiraclient.JiraException: Field expects an Iterable value
          {code}

          And on the User Picker, error:

          net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"customfield_10100":"data was not an object"}}

          The configuration I use to update both is attached as a screenshot.

          What is the correct format to update such custom fields through this plugin? I tried matching the JIRA REST API documentation but probably didn't get that exactly.
          New: I'm using the jira-ext plugin for jenkins, and try to update custom fields (in JIRA) of type Label and User Picker (single user) as part of my build. The update fails on the Label update stating:

          {code}
          net.rcarz.jiraclient.JiraException: Field expects an Iterable value
          {code}

          And on the User Picker, error:

          {code}
          net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"customfield_10100":"data was not an object"}}
          {code}

          The configuration I use to update both is attached as a screenshot.

          What is the correct format to update such custom fields through this plugin? I tried matching the JIRA REST API documentation but probably didn't get that exactly.

          Dan Alvizu added a comment -

          "Update a field" only works for types which the JIRA API accepts as a plain old JSON String, the user-picker sounds like a select field which doesn't qualify so no sadly it's not supported.

          Label is a special case which is supported as a JIRA operation available to add ("Add a Label"):

          https://github.com/jenkinsci/jira-ext-plugin/blob/master/src/main/java/org/jenkinsci/plugins/jiraext/view/AddLabel.java

          Dan Alvizu added a comment - "Update a field" only works for types which the JIRA API accepts as a plain old JSON String, the user-picker sounds like a select field which doesn't qualify so no sadly it's not supported. Label is a special case which is supported as a JIRA operation available to add ("Add a Label"): https://github.com/jenkinsci/jira-ext-plugin/blob/master/src/main/java/org/jenkinsci/plugins/jiraext/view/AddLabel.java
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 173553 ] New: JNJira + In-Review [ 185193 ]

          Oren Schor added a comment -

          Is Label supported also for a custom field? because I don't want to add a label but rather update a custom field ("Fixed in Build") which is of type Label.

          Oren Schor added a comment - Is Label supported also for a custom field? because I don't want to add a label but rather update a custom field ("Fixed in Build") which is of type Label.

          Dan Alvizu added a comment -

          Ah, gotcha, no that's not supported

          Dan Alvizu added a comment - Ah, gotcha, no that's not supported

          Oren Schor added a comment -

          Thanks -
          1. Is there a list of the custom field types that ARE supported?
          2. What do I need to implement in order to support update of User Picker customer field and Label custom field?

          Oren Schor added a comment - Thanks - 1. Is there a list of the custom field types that ARE supported? 2. What do I need to implement in order to support update of User Picker customer field and Label custom field?

            dalvizu Dan Alvizu
            oren Oren Schor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: