Skip to content

Commit 87694e9

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 b57c08d commit 87694e9

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
@@ -871,25 +871,25 @@ def get_field(self, field_name: str) -> Any:
871871
else:
872872
return getattr(self.fields, field_name)
873873

874-
def add_field_value(self, field: str, value: str):
874+
def add_field_value(self, field: str, value: Any):
875875
"""Add a value to a field that supports multiple values, without resetting the existing values.
876876
877877
This should work with: labels, multiple checkbox lists, multiple select
878878
879879
Args:
880880
field (str): The field name
881-
value (str): The field's value
881+
value (Any): The field's value
882882
"""
883883
super().update(fields={"update": {field: [{"add": value}]}})
884884

885-
def remove_field_value(self, field: str, value: str):
885+
def remove_field_value(self, field: str, value: Any):
886886
"""Remove a value from a field that supports multiple values, without resetting the existing values.
887887
888888
This should work with: labels, multiple checkbox lists, multiple select
889889
890890
Args:
891891
field (str): The field name
892-
value (str): The field's value
892+
value (Any): The field's value
893893
"""
894894
super().update(fields={"update": {field: [{"remove": value}]}})
895895

0 commit comments

Comments
 (0)