How to update custom field values with drop down options/ multiple options available?

rithwik_poleneni March 1, 2020

I need to update a custom field in JIRA using Python. I checked other answers and they only provide solution for text fields. But I have a multi value list that I would like to update using Python.

I tried this but it doesn't work.

```
issue.update(fields={'customfield_13090': {'value':'64'}})

AND

issue.update(fields={'customfield_13090': {'value':'Implementation Services'}})
```

I'm getting this error when I run that line


```
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://test.jira.com/rest/api/2/issue/1400908679
text: Can not deserialize instance of java.lang.Long out of START_OBJECT token
at [Source: N/A; line: -1, column: -1]
```

I inspected the list field and found that value 64 is the option value that I need to update if I want the list to have Implementation Services as the selected option.

```
<option selected="selected" value="64">
Implementation Services
</option>
```

Can some one please tell me what is the mistake in my line of code.

 

1 answer

0 votes
Sajit Nair
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 1, 2020

Hello @rithwik_poleneni , Welcome to the community.
before anyone from the community delves into scripting correctness, can you please share your use case ?
"I need to update a custom field in JIRA using Python."

I ask this, to know if there is an easier fix for the problem.

Thirupathi Edla July 11, 2020

You can try the below
issue.update(fields= {"customfield_1234": [{"value": "abc"}]})

Suggest an answer

Log in or Sign up to answer