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

Cannot update JIRA custom field through jira-ext plugin

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          dalvizu Dan Alvizu added a comment -

          Ah, gotcha, no that's not supported

          Show
          dalvizu Dan Alvizu added a comment - Ah, gotcha, no that's not supported
          Hide
          oren 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?

          Show
          oren 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?
          Hide
          dalvizu Dan Alvizu added a comment -

          > 1. Is there a list of the custom field types that ARE supported?

          So far the only type that is supported is one that accepts just a String, but I don't have any way of translating that to JIRA types – such a list would be immensely helpful, but I can't find one.

          > 2. What do I need to implement in order to support update of User Picker customer field and Label custom field?

          You'd need to create a child of `JiraOperationExtension` much like `UpdateField` does – https://github.com/jenkinsci/jira-ext-plugin/blob/master/src/main/java/org/jenkinsci/plugins/jiraext/view/UpdateField.java – to accept your type of value.

          There is some support in the service layer to update a JIRA issue differently - it supports multi-select:

          https://github.com/jenkinsci/jira-ext-plugin/commit/5169f766c3300a37832f6c3db63d2f4fc1069602#diff-58571f6471a1cc5206d122c9a2632334R125

          Depending on what your field accepts, you might be able to use this, or might have to extend the service layer more to accept the other type.

          Show
          dalvizu Dan Alvizu added a comment - > 1. Is there a list of the custom field types that ARE supported? So far the only type that is supported is one that accepts just a String, but I don't have any way of translating that to JIRA types – such a list would be immensely helpful, but I can't find one. > 2. What do I need to implement in order to support update of User Picker customer field and Label custom field? You'd need to create a child of `JiraOperationExtension` much like `UpdateField` does – https://github.com/jenkinsci/jira-ext-plugin/blob/master/src/main/java/org/jenkinsci/plugins/jiraext/view/UpdateField.java – to accept your type of value. There is some support in the service layer to update a JIRA issue differently - it supports multi-select: https://github.com/jenkinsci/jira-ext-plugin/commit/5169f766c3300a37832f6c3db63d2f4fc1069602#diff-58571f6471a1cc5206d122c9a2632334R125 Depending on what your field accepts, you might be able to use this, or might have to extend the service layer more to accept the other type.
          Hide
          anilgchauhan anil chauhan added a comment -

          I am trying to update a field which requires numeric value and getting an error as shown below. 
          ChangeLogSet class: class hudson.plugins.git.GitChangeSetList
          Operation: Update a Field
          Error updating ticket, continuing
          net.rcarz.jiraclient.JiraException: Field expects a Numeric value
          at net.rcarz.jiraclient.Field.toJson(Field.java:611)
          at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:171)
          Any update on when will it support Numeric updates. 

          Show
          anilgchauhan anil chauhan added a comment - I am trying to update a field which requires numeric value and getting an error as shown below.  ChangeLogSet class: class hudson.plugins.git.GitChangeSetList Operation: Update a Field Error updating ticket, continuing net.rcarz.jiraclient.JiraException: Field expects a Numeric value at net.rcarz.jiraclient.Field.toJson(Field.java:611) at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:171) Any update on when will it support Numeric updates. 
          Hide
          dalvizu Dan Alvizu added a comment -

          Pull requests accepted - I am not planning to implement this 

          Show
          dalvizu Dan Alvizu added a comment - Pull requests accepted - I am not planning to implement this 

            People

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

              Dates

              • Created:
                Updated: