knaufk commented on a change in pull request #14:
URL: https://github.com/apache/flink-jira-bot/pull/14#discussion_r635004225
##########
File path: stale_assigned_rule.py
##########
@@ -41,5 +41,26 @@ def run(self):
f"AND updated < startOfDay(-{self.stale_days}d)"
)
- def handle_stale_ticket(self, key):
- self.unassign(key)
+ def handle_stale_ticket(self, key, warning_label, done_label, comment):
+ self.unassign(key, warning_label, done_label, comment)
+
+ def unassign(self, key, warning_label, done_label, comment):
+ if not self.is_dry_run:
+ if self.jira_client.get_issue_status(key) == "In Progress":
+ self.jira_client.edit_issue(
+ key,
+ {"assignee": [{"set": {"name":
self.jira_client.username}}]},
+ notify_users=False,
+ )
+ self.jira_client.set_issue_status(key, "Open")
+ self.jira_client.edit_issue(
+ key,
+ {
+ "labels": [{"add": done_label}, {"remove": warning_label}],
+ "comment": [{"add": {"body": comment}}],
+ "assignee": [{"set": {"name": None}}],
+ },
+ notify_users=False,
+ )
Review comment:
So, they can't be combined. The fields that you can set with a
transition are quite limited, see:
https://issues.apache.org/jira/rest/api/2/issue/FLINK-22570/transitions?expand=transitions.fields
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]