Skip to content

Conversation

@PoojasPatel013
Copy link
Contributor

Closes #13592 (Work in Progress)

This PR implements automatic unique ID generation for Engagements. When a new engagement is created, the system assigns a sequential ID (e.g., ENG-0001, ENG-0002) and displays it in the UI.
Changes Implemented

  1. Model: Added custom_engagement_id to Engagement model.
  2. Logic: Overridden save() method to query the last ID and increment it.
  3. UI: Updated view_engagement.html to display the ID next to the header.
    Configuration
    The format can be configured via environment variables or local_settings.py:
  • ENG-{id:03d} -> ENG-001
  • ENG-{id:04d} -> ENG-0001
  • ENG-{id} -> ENG-1
    etc.
    Test Results & Verification
  1. Database: Ran makemigrations and migrate successfully.
  2. Creation: Successfully created new Engagements without errors.
  3. List Views: Verified "Engagement ID" column appears in: Engagements -> All Engagements , Engagements -> Active Engagements, Product -> Engagements Tab
  4. Stability: Verified that pages for the Engagement sec load correctly.

Pending Edge Case (Need Feedback)
I am currently debugging behavior related to deleted engagements.

  • Current behavior: If I delete the last engagement (e.g., ENG-0005), the query Engagement.objects.last() might behave unexpectedly depending on how DefectDojo handles "Soft Deletes" vs "Hard Deletes."

@github-actions github-actions bot added settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR docs unittests ui parser helm labels Dec 9, 2025
@PoojasPatel013 PoojasPatel013 marked this pull request as draft December 9, 2025 14:25
@Maffooch
Copy link
Contributor

Maffooch commented Dec 9, 2025

Hi @PoojasPatel013 PR are only accepted against the dev or bugfix branch

@PoojasPatel013
Copy link
Contributor Author

PoojasPatel013 commented Dec 10, 2025

Hi, This draft PR is not meant to be merged, I needed few feedback from @valentijnscholten and update on progress.

@PoojasPatel013 PoojasPatel013 changed the base branch from master to bugfix December 10, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs helm parser settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR ui unittests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable automatic numbering for engagements using a customizable format (e.g., ENG-0001).

2 participants