Source: factory.core/ObjTicket.py
Core ticket for user/internal request tracking.
Orchestrates ticket lifecycle including status
transitions, SLA deadline calculation, task
management, audit trail, and work scoring.
...
| Method | Signature | Description |
|---|---|---|
| get_provider | get_provider() |
Return the configured ObjTicketProvider |
| ensure_sla_raci | ensure_sla_raci() -> None |
Add RACI columns to def_ticket_sla |
| read | read(guid: str) -> int |
Load a ticket by its guid. |
| read_by_number | read_by_number(ticket_number: int) -> int |
Load a ticket by its human-readable number. |
| create | create(subject: str, description: str = '', priority: str = TicketPriority.MEDIUM, ticket_type: str = TicketType.USER, requested_by: str = '', requested_by_type: str = RequestedByType.INTERNAL, server_id: str = '', project: str = '') -> str |
Create a new ticket with SLA deadlines. |
| Create | Create(subject: str = '', description: str = '', priority: str = TicketPriority.MEDIUM, ticket_type: str = TicketType.USER, requested_by: str = '', requested_by_type: str = RequestedByType.INTERNAL, server_id: str = '', **legacy_kwargs) -> str |
Backward-compatible wrapper for create(). |
| update | update() -> None |
Update the current ticket record. |
| set_server_id | set_server_id(server_id: str, action_by: str = '') -> None |
Set or update the server/system id for the ticket. |
| assign | assign(user: str, action_by: str = '') -> None |
Assign ticket to a user. |
| change_status | change_status(new_status: str, action_by: str = '') -> None |
Transition ticket to a new status. |
| add_analysis | add_analysis(analysis: str, action_by: str = '') -> None |
Set the problem analysis for the ticket. |
| set_incident_date | set_incident_date(incident_date: str | datetime, action_by: str = '', allow_future: bool = False) -> None |
Set incident start datetime for a ticket. |
| set_incident_cause | set_incident_cause(incident_cause: str, action_by: str = '') -> None |
Set incident cause for a ticket. |
| set_work_score | set_work_score(score: int, action_by: str = '') -> None |
Set the effort/work score for the ticket. |
| resolve | resolve(action_by: str = '', notes: str = '') -> None |
Resolve the ticket and check SLA compliance. |
| close | close(action_by: str = '') -> None |
Close the ticket. |
| escalate | escalate(action_by: str = '') -> None |
Escalate the ticket. Uses RACI contacts |
| add_task | add_task(task_name: str, description: str = '', assigned_to: str = '', pull_request: str = '') -> str |
Add a task to this ticket. |
| get_tasks | get_tasks() -> list |
Get all tasks for this ticket. |
| add_comment | add_comment(text: str, commented_by: str = '', is_internal: str = 'N') -> str |
Add a comment to this ticket. |
| get_comments | get_comments(include_internal: bool = False) -> list |
Get comments for this ticket. |
| add_link | add_link(target_guid: str, link_type: str = LinkType.RELATED, created_by: str = '') -> str |
Link this ticket to another. |
| get_links | get_links() -> list |
Get all links for this ticket. |
| add_document | add_document(file_name: str, file_data_b64: str, mime_type: str = '', file_size: int = 0, uploaded_by: str = '', package: str = '') -> str |
Add an attachment document to this ticket. |
| get_documents | get_documents(ticket_guid: str = '') -> list |
List attachment metadata for a ticket. |
| get_document | get_document(document_guid: str, ticket_guid: str = '') -> dict |
Fetch one attachment including FileData, scoped to a ticket. |
| delete_document | delete_document(document_guid: str, action_by: str = '') -> None |
Soft-delete an attachment from this ticket. |
| create_from_template | create_from_template(template_name: str, requested_by: str, requested_by_type: str = RequestedByType.INTERNAL) -> str |
Create a ticket from a template. |
| get_history | get_history(guid: str = '') -> list |
Get audit trail for a ticket. |
| get_open_tickets | get_open_tickets(package: str = '') -> list |
Get all open tickets for a package. |
| get_overdue_tickets | get_overdue_tickets() -> list |
Get all tickets that have breached SLA. |
| get_status_summary | get_status_summary(package: str = '') -> list |
Get ticket counts grouped by status. |
| get_tickets_by_assignee | get_tickets_by_assignee(assignee: str) -> list |
Get active tickets for an assignee. |
| get_unassigned_tickets | get_unassigned_tickets() -> list |
Get active tickets with no assignee. |
| get_sla_breach_count | get_sla_breach_count() -> int |
Count tickets that have breached SLA. |
| get_tickets_by_filter | get_tickets_by_filter(package: str = '', status: str = '', priority: str = '', assignee: str = '') -> list |
Get tickets matching optional filters. |
| check_escalation_due | check_escalation_due() -> list |
Get tickets that are due for escalation |
| add_watcher | add_watcher(email: str) -> None |
Add a watcher email to this ticket. |
| remove_watcher | remove_watcher(email: str) -> None |
Remove a watcher email from this ticket. |
| get_watchers | get_watchers() -> list |
Parse watchers CSV into a list. |
| track | track(ticket_guid: str, action: str, old_value: str, new_value: str, action_by: str = '') -> None |
Write an audit trail entry. |
| link_pull_request | link_pull_request(ticket_guid: str, pr_id: str, repo: str = '') -> str |
Link a Bitbucket pull request to a ticket |
| get_linked_prs | get_linked_prs(ticket_guid: str) -> list |
Return pull requests linked to a ticket. |
| create_from_pr | create_from_pr(pr_data: dict) -> str |
Create a ticket from a Bitbucket pull |
| create_from_email | create_from_email(sender: str, subject: str, body: str, priority: str = TicketPriority.MEDIUM, sent_on: str = '') -> str |
Create a ticket from an inbound email. |
| merge_ticket | merge_ticket(source_guid: str, action_by: str = '') -> bool |
Merge another ticket into this one. |
| escalate_overdue | escalate_overdue() -> int |
Check and escalate all overdue tickets. |
| process_slack_approval | process_slack_approval(payload: dict) -> str |
Process a Slack interactive approval |
| send_weekly_digest | send_weekly_digest(recipients: str = '') -> None |
Build and send a branded weekly ticket |
| log_time | log_time(ticket_guid: str, person_email: str, duration_minutes: int, description: str = '', start_time: str = '', end_time: str = '') -> str |
Log a time entry against a ticket. |
| get_time_entries | get_time_entries(ticket_guid: str) -> list |
List all time entries for a ticket. |
| get_total_time | get_total_time(ticket_guid: str) -> int |
Return the sum of DurationMinutes for a |
| set_eta | set_eta(ticket_guid: str, eta_date: str) -> None |
Set the estimated completion date for a |
| get_eta_display | get_eta_display(estimated_date: str = '') -> str |
Return a human-readable ETA string. |
| notify_event | notify_event(notify_code: str, action_by: str = '') -> None |
Send a notification with the full ticket |
| send_ticket_report | send_ticket_report(recipients: str = '') -> None |
Generate and send a branded HTML email |
Read a ticket by guid.
Create a new ticket.
List open tickets.
List overdue tickets.
Check and escalate overdue tickets.
Merge source ticket into target ticket.
Send a branded HTML report for a ticket.
Send a weekly ticket digest email.
List auto-assign rules for a package.
Add an auto-assign rule.
Remove an auto-assign rule by ID.
Log time against a ticket.
Set the ETA for a ticket.
List recurring ticket schedules.
Schedule a recurring ticket.
Check and create due recurring tickets.
Launch the interactive ticket dashboard.