Skip to content

Commit 221a0a9

Browse files
committed
fields values to add/removed are not always string
for example to add/remove a version the name or id must be used: issue.add_field_value('fixVersions', {'name': version})` or `issue.add_field_value("fixVersions", {"id": fix_version.id})` Closes: #1724
1 parent 01fca2f commit 221a0a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jira/resources.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -893,25 +893,25 @@ def get_field(self, field_name: str) -> Any:
893893
else:
894894
return getattr(self.fields, field_name)
895895

896-
def add_field_value(self, field: str, value: str):
896+
def add_field_value(self, field: str, value: Any):
897897
"""Add a value to a field that supports multiple values, without resetting the existing values.
898898
899899
This should work with: labels, multiple checkbox lists, multiple select
900900
901901
Args:
902902
field (str): The field name
903-
value (str): The field's value
903+
value (Any): The field's value
904904
"""
905905
super().update(fields={"update": {field: [{"add": value}]}})
906906

907-
def remove_field_value(self, field: str, value: str):
907+
def remove_field_value(self, field: str, value: Any):
908908
"""Remove a value from a field that supports multiple values, without resetting the existing values.
909909
910910
This should work with: labels, multiple checkbox lists, multiple select
911911
912912
Args:
913913
field (str): The field name
914-
value (str): The field's value
914+
value (Any): The field's value
915915
"""
916916
super().update(fields={"update": {field: [{"remove": value}]}})
917917

0 commit comments

Comments
 (0)