Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Issue with custom field using REST API "Specify the value in an array" error

Piercen Di Berardo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 25, 2024

Hi,

I am trying to move tickets from autotask to jira. I can retrieve the information from autotask and create a corresponding jira ticket, but when I try to use our custom "Organizations" field, the custom field gives me issues. The organizations field is a multi-select list. When I query the custom field I get the json below. I am using python, and I tried hard-coding the Organizations field for a ticket, yet I still got the same error "Error 400: {"errorMessages":[]."errors":{"customfield_10002":"Specify the value for the Organizations in an array"}}.

I have tried everything I can think of, yet I still cannot get the Organizations field to work. Any suggestions would be greatly appreciated.

 

[
  {
    "id": 6,
    "name": "PLACEHOLDER_NAME",
    "domain": ""
  }
]

 

formatted_ticket = {

        "fields": {

            "assignee": {

                "id": assignee

            } if assignee else None,

            "summary": ticket.get("title", "No title provided"),

            "description": {

                "content": [

                    {

                        "content": [

                            {

                                "text": (ticket.get('description') or 'No Description') + additional_info,

                                "type": "text"

                            }

                        ],

                        "type": "paragraph"

                    }

                ],

                "type": "doc",

                "version": 1

            },

            "issuetype": {

                "id": "10003"

            },

            "priority": {

                "id": str(ticket.get("priority", 3))

            },

            "project": {

                "key": "LAT256"

            },

            "customfield_10002": [

                        {

                            "id": "6",

                            "name": "PLACEHOLDER_NAME",

                            "domain": ""

                        }

                    ],

            "labels": company.split(' ') if company != 'N/A' else [],

        },

        "update": {}

    }

1 answer

0 votes
Jehan Bhathena
Community Champion
October 26, 2024

Hi @Piercen Di Berardo 

Your syntax for the field looks correct, tested this at my end for a "Select List (multiple choices)" custom field and it worked:

image.png

You can try this API https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-editmeta-get, to verify if the parameters that you're passing are correct.

I'm not a python dev, but can you check if are you passing the "labels" in an array too?

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events