Open swordfish0x0 opened 10 months ago
The type hints appear to be incorrect, it does not always take a string. (in the case of the labels
field a plain string work)
But for more complex fields a dictionary may be required, for example the following works to add a fixVersion, and the use of dictionary with name
appears to be required:
version = "1.2.3"
issue.add_field_value('fixVersions', {'name': version})
The type hint on the function should probably be replaced with Any
instead of string.
Bug summary
using Jira python library 3.5.2
I'm attempting to add a version to the versions list and this fails.
The code can successsfully get the issue ticket... issue = jira.issue(TICKET_ID)
get the versions.. x = issue.get_field('versions')
Now...if I call issue.add_field_value('versions', ADD_THIS_VERSION_STR)
This call fails with a thrown error message
response text = {"errorMessages":[],"errors":{"versions":"Could not find valid 'id' or 'name' in version object."}}
The docs and comments say takes a string and a string see https://jira.readthedocs.io/api.html#jira.resources.Issue.add_field_value
says: " add_field_value(field: str, value: str) Add a value to a field that supports multiple values, without resetting the existing values. This should work with: labels, multiple checkbox lists, multiple select"
Is there an existing issue for this?
Jira Instance type
Jira Server or Data Center (Self-hosted)
Jira instance version
8.20.19
jira-python version
3.5.2
Python Interpreter version
3.9
Which operating systems have you used?
Reproduction steps
Stack trace
Expected behaviour
the issue.add_field_value should work and add the value to the list or docs should be updated to explain correctly how to use this api.
Additional Context
No response