Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-30892

REST API requires inconsistent type for custom fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 5.1.5, 5.2.1
    • Java API, REST API

      When using the REST API to fill out custom fields, I find myself having to special-case things that are counter-intuitive or go against what the API tells me I should fill out.

      Example:

      A Select custom field's schema returned from the API looks something like

       u'schema':{
            u'type':u'string',
            u'custom': u'com.atlassian.jira.plugin.system.customfieldtypes:select',
            u'customId':10001
         },
      

      However, if you post either the ID or Value associated with any custom field option to the API as a string, it complains "Could not find valid 'id' or 'value' in the Parent Option object.".

      After posting an object with the associated value or id wrapped in a JSON object, everything is in order. But my issue is that the API is requiring me to violate the schema that it has told me that it accepts. This makes me as a JIRA API developer have to create obscene special cases in otherwise clean code to single these out.

              Unassigned Unassigned
              65b1244dbf06 adam thurlow
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: