Skip to content

Set Jira "Was data deleted?" flag to Yes after Box data cleanup#2

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-jira-variable-was-data-deleted
Draft

Set Jira "Was data deleted?" flag to Yes after Box data cleanup#2
Copilot wants to merge 2 commits into
mainfrom
copilot/add-jira-variable-was-data-deleted

Conversation

Copilot AI commented Mar 11, 2026

Copy link
Copy Markdown

After data files are deleted from Box, there is no mechanism to mark the corresponding Jira issue as having its data deleted, nor any reminder to clean up local copies. This adds direct Jira API integration to clean_box_folders.py to fill that gap.

Changes

New Jira integration in BoxCleanup:

  • authenticate_jira() — lazy Jira auth via JIRA_USERNAME / JIRA_API_KEY / JIRA_SERVER; returns bool so cleanup continues gracefully on auth failure
  • set_data_deleted_flag(case_number) — resolves the Was data deleted? custom field ID (cached in _jira_field_map across cases) and updates the issue via issue.update(fields={field_id: {'value': 'Yes'}})
  • query_and_set_data_deleted(case_number, folder_name, auto_confirm) — prints a prominent reminder that all local copies must be manually deleted, then prompts the user or auto-confirms via --yes

Flow changes:

  • process_case_folder() calls query_and_set_data_deleted() after file deletion; accepts auto_confirm param
  • run() propagates auto_confirm into process_case_folder()
  • --skip-jira-check suppresses the flag update as well
  • Summary output now reports jira_flags_set count

Other:

  • jira import is optional (JIRA_AVAILABLE guard); missing library only errors at the point of use
  • JIRA_DATA_DELETED_FIELD = 'Was data deleted?' constant for easy field name updates
  • JIRA_SERVER env var documented in module docstring and --help epilog
Original prompt

This section details on the original issue you should resolve

<issue_title>Add function to set the Jira variable "was data deleted" to yes</issue_title>
<issue_description>There is a JIRA variable that tracks whether the data have been deleted. While setting it to yes does not by itself remove all copies, the clean up on disk should be run before this check anyway.

  • Create a query to whether to set that flag, and remind that all local copies need to be manually deleted
  • then set the flag via the JIRA API</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: larsvilhuber <7022712+larsvilhuber@users.noreply.github.com>
Copilot AI changed the title [WIP] Add function to set Jira variable for data deletion Set Jira "Was data deleted?" flag to Yes after Box data cleanup Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add function to set the Jira variable "was data deleted" to yes

2 participants