Skip to content

Commit db4f442

Browse files
committed
Leave downstream assignment to owner when upstream is clear
1 parent 70efc52 commit db4f442

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sync2jira/downstream_issue.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,15 +906,19 @@ def _update_assignee(client, existing, issue, overwrite):
906906
existing.fields.assignee, "displayName"
907907
)
908908
if overwrite:
909-
if ds_exists and us_exists:
909+
if not ds_exists:
910+
# Let assign_user() figure out what to do.
911+
update = True
912+
elif us_exists:
910913
# Overwrite the downstream assignment only if it is different from
911914
# the upstream one.
912915
un = issue.assignee[0]["fullname"]
913916
dn = existing.fields.assignee.displayName
914917
update = un != dn and remove_diacritics(un) != dn
915918
else:
916-
# Let assign_user() figure out what to do.
917-
update = True
919+
# Without an upstream owner, update only if the downstream is not
920+
# assigned to the project owner.
921+
update = issue.downstream.get("owner") != existing.fields.assignee
918922
else:
919923
# We're not overwriting, so call assign_user() only if the downstream
920924
# doesn't already have an assignment.

0 commit comments

Comments
 (0)