From b4af7436a25d84306442627f586544ca4465129a Mon Sep 17 00:00:00 2001 From: Webb Scales Date: Wed, 20 Nov 2024 15:46:45 -0500 Subject: [PATCH] Add a guard to the downstream issue for unexpected github_project_field values --- sync2jira/downstream_issue.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sync2jira/downstream_issue.py b/sync2jira/downstream_issue.py index f33a364..af732da 100644 --- a/sync2jira/downstream_issue.py +++ b/sync2jira/downstream_issue.py @@ -975,6 +975,10 @@ def _update_github_project_fields(client, existing, issue, default_jira_fields = config['sync2jira'].get('default_jira_fields', {}) for name, values in github_project_fields.items(): + if name not in dir(issue): + log.error(f"Configuration error: github_project_field key, {name:r}, is not in issue object.") + continue + log.info(f"Looking at GHP field '{name}' with configuration '{values}'") fieldvalue = getattr(issue, name) log.info(f"Issue value for field '{name}' is '{fieldvalue}'")