Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Add missing ticket action comments #508

Merged
merged 16 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a58cb1e
feat(core): When changing a ticket milestone create an action comment…
jon-nfc Jan 27, 2025
c918578
feat(core): When changing a ticket planned start date create an actio…
jon-nfc Jan 27, 2025
efd205c
feat(core): When changing a ticket planned finish date create an acti…
jon-nfc Jan 27, 2025
2865c3d
feat(core): When changing a ticket real start date create an action c…
jon-nfc Jan 27, 2025
4c5c460
feat(core): When changing a ticket real finish date create an action …
jon-nfc Jan 27, 2025
120380a
docs(roadmap): update
jon-nfc Jan 27, 2025
76e7d64
refactor(core): Ticket action comment for changing project to use ite…
jon-nfc Jan 27, 2025
7572763
refactor(core): Ticket action comment for changing milestone to use i…
jon-nfc Jan 27, 2025
467fc18
test(core): Ticket Action comment tests moved to their own suite
jon-nfc Jan 27, 2025
7190354
test(core): Ticket Action comment test cases for project actions
jon-nfc Jan 27, 2025
f7543ce
test(core): Ticket Action comment test cases for milestone actions
jon-nfc Jan 27, 2025
98bc0fc
fix(core): Ticket Action comment date fields must be checked if empty…
jon-nfc Jan 27, 2025
744d9a2
test(core): Ticket Action comment test cases for planned_start_date a…
jon-nfc Jan 27, 2025
3291389
test(core): Ticket Action comment test cases for planned_finish_date …
jon-nfc Jan 27, 2025
de2722f
test(core): Ticket Action comment test cases for real_start_date actions
jon-nfc Jan 27, 2025
26e475a
test(core): Ticket Action comment test cases for real_finish_date act…
jon-nfc Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 77 additions & 1 deletion app/core/models/ticket/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,83 @@ def save(self, force_insert=False, force_update=False, using=None, update_fields

if field == 'project_id':

comment_field_value = f"changed {field.replace('_id','')} to {self.project}"
value = 'None'

if before[field]:

value = f"$project-{before[field]}"

to_value = getattr(self.project, 'id', 'None')

if to_value != 'None':

to_value = f"$project-{getattr(self.project, 'id', 'None')}"


comment_field_value = f"changed project from {value} to {to_value}"

if field == 'milestone_id':

value = 'None'

if before[field]:

value = f"$milestone-{before[field]}"

to_value = getattr(self.milestone, 'id', 'None')

if to_value != 'None':

to_value = f"$milestone-{getattr(self.milestone, 'id', 'None')}"


comment_field_value = f"changed milestone from {value} to {to_value}"

if field == 'planned_start_date':

to_value = after[field]

if to_value:

to_value = str(after[field].utcfromtimestamp(after[field].timestamp()))+ '+00:00'

comment_field_value = f"changed Planned Start Date from _{before[field]}_ to **{to_value}**"

if field == 'planned_finish_date':

to_value = after[field]

if to_value:

to_value = str(after[field].utcfromtimestamp(after[field].timestamp()))+ '+00:00'

comment_field_value = f"changed Planned Finish Date from _{before[field]}_ to **{to_value}**"

if field == 'real_start_date':

to_value = after[field]

if to_value:

to_value = str(after[field].utcfromtimestamp(after[field].timestamp()))+ '+00:00'

comment_field_value = f"changed Real Start Date from _{before[field]}_ to **{to_value}**"

to_value = after[field]

if to_value:

to_value = str(after[field].utcfromtimestamp(after[field].timestamp()))+ '+00:00'

if field == 'real_finish_date':

to_value = after[field]

if to_value:

to_value = str(after[field].utcfromtimestamp(after[field].timestamp()))+ '+00:00'

comment_field_value = f"changed Real Finish Date from _{before[field]}_ to **{to_value}**"


if comment_field_value:
Expand Down
Loading
Loading