skip to Main Content

Does anyone have an idea of creating an array and option type customfield issue ?
If anyone does have leads, please suggest some.
although i tried to do some changes around here but no luck.

(customfield_15101={"value": target_department})

———-main error———

text: data was not an array
url: http://jira/rest/api/2/issue
response headers = {'X-AUSERNAME': 'rest_api', 'X-ASEN': 'SEN-2710437', 'X-XSS-Protection': '1; mode=block', 'Content-Security-Policy': "frame-ancestors 'self'", 'X-Content-Type-Options': 'nosniff', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'X-AREQUESTID': '362x28422825x1', 'X-ASESSIONID': 'xhojwj', 'Connection': 'close', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Thu, 18 Aug 2022 05:02:01 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Server': 'Apache/2.4.6 (CentOS) PHP/5.4.16', 'Content-Type': 'application/json;charset=UTF-8', 'Access-Control-Allow-Origin': '*'}
response text = {"errorMessages":[],"errors":{"Target Department/s":"data was not an array"}}

issue = JIRA_INTERFACE.create_issue(customfield_15101={"value": target_department})

jira meta for this customfield:
{"type":"array","items":"option","custom":"com.atlassian.jira.plugin.system.customfieldtypes:multiselect","customId":15101},"name":"Target Department/s","hasDefaultValue":false,"operations":["add","set","remove"],"allowedValues":[{"self":"http://jira/rest/api/2/customFieldOption/14189","value":"All Departments","id":"14189"},

2

Answers


  1. Chosen as BEST ANSWER
    issue = JIRA_INTERFACE.create_issue(customfield_15101={u"value":u"RPM"})
    

    whenever you try to create issue, first retrieve values and check whether the value are unicode.


  2. although i tried to use

    issue = JIRA_INTERFACE.create_issue(customfield_15101={"value":"RPM"})
    

    but no luck

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search