feat: Regular Time entry support with name resolution helpers#153
Closed
shaank0 wants to merge 3 commits intowyre-technology:mainfrom
Closed
feat: Regular Time entry support with name resolution helpers#153shaank0 wants to merge 3 commits intowyre-technology:mainfrom
shaank0 wants to merge 3 commits intowyre-technology:mainfrom
Conversation
The transformRequest function was setting Content-Encoding: gzip on request headers but sending the body as plain JSON (not actually gzip-compressed). This caused the Autotask API to return 500 errors on POST requests, particularly for child entity creates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a new createDirect() method to the TimeEntries entity that POSTs directly to /TimeEntries without requiring a parent ticket, task, or project. This enables creating "Regular Time" entries for meetings, admin work, training, and other non-ticket time tracking. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds SDK-level helpers for creating Regular Time entries:
- TimeTrackingClient.createRegularTimeEntry(): Creates a time entry
not tied to a ticket/task/project, automatically setting
timeEntryType=5 (Activity) and handling the itemId response format
- CoreClient.searchResources(): Search resources by name or email
- CoreClient.resolveResourceByName(): Resolve a full name like
"Will Spence" to a resource ID, splitting first/last name for
accurate matching
- FinancialClient.getInternalBillingCodes(): Get BillingCodes with
useType=3, which are the valid categories for Regular Time entries
(e.g., Internal Meeting, Training, PTO)
- FinancialClient.resolveInternalBillingCodeByName(): Resolve a
category name to a billing code ID with fuzzy matching
Key Autotask API details:
- Regular Time entries require internalBillingCodeID (not billingCodeID)
- Only BillingCodes with useType=3 are valid for internal allocation
- timeEntryType=5 (Activity) is required for Regular Time
- The API returns {itemId: N} for creates, not {id: N}
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks
asachs01
added a commit
that referenced
this pull request
Mar 15, 2026
Adds convenience methods for creating non-ticket time entries:
- TimeEntries.createDirect() — POST /TimeEntries without parent scope
- TimeTrackingClient.createRegularTimeEntry() — creates Regular Time
entries with timeEntryType=5 (Activity), requires internalBillingCodeID
- CoreClient.searchResources() / resolveResourceByName() — search and
resolve resources by full name with first/last split logic
- FinancialClient.getInternalBillingCodes() / resolveInternalBillingCodeByName()
— fetch and resolve BillingCodes with useType=3 (internal allocation codes)
Key Autotask API discoveries documented in code:
- Regular Time requires internalBillingCodeID (NOT billingCodeID)
- Only BillingCodes with useType=3 are valid for Regular Time categories
- API returns { itemId: N } for creates, not { id: N }
- timeEntryType=5 (Activity) is required for Regular Time
Rebased from shaank0/feat/regular-time-entries (PR #153) onto main,
keeping main's gzip compression implementation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
Collaborator
asachs01
added a commit
that referenced
this pull request
Mar 15, 2026
Adds convenience methods for creating non-ticket (Regular) time entries: TimeEntries.createDirect(), TimeTrackingClient.createRegularTimeEntry(), CoreClient.searchResources()/resolveResourceByName(), FinancialClient.getInternalBillingCodes()/resolveInternalBillingCodeByName(). Rebased from shaank0 PR #153.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Content-Encoding: gzipwas being set on requests without actually compressing the body, causing 500 errors on POST requestscreateDirect()to TimeEntries — enables creating time entries viaPOST /TimeEntrieswithout requiring a parent ticket/task/project URLTimeTrackingClient.createRegularTimeEntry()— creates non-ticket time entries, auto-setstimeEntryType=5(Activity), handlesitemIdresponse formatCoreClient.searchResources()/resolveResourceByName()— search and resolve resources by full name (splits first/last for accurate matching)FinancialClient.getInternalBillingCodes()/resolveInternalBillingCodeByName()— get and resolve BillingCodes withuseType=3(internal allocation codes for Regular Time categories)Key Autotask API discoveries documented in code:
internalBillingCodeID(NOTbillingCodeID)useType=3are valid for internal allocation (Internal Meeting, Training, PTO, etc.)timeEntryType=5(Activity) is required for Regular Time{itemId: N}for creates, not{id: N}internalBillingCodeIDTest plan
createDirect()POSTs to/TimeEntrieswithout parent scopingcreateRegularTimeEntry()setstimeEntryType=5automaticallyresolveResourceByName("Will Spence")correctly splits and resolvesresolveInternalBillingCodeByName("Internal Meeting")returns correct IDgetInternalBillingCodes()only returnsuseType=3codes🤖 Generated with Claude Code