feat: Regular Time entry support with name resolution helpers#155
Merged
feat: Regular Time entry support with name resolution helpers#155
Conversation
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>
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
Adds convenience methods for creating non-ticket (Regular) time entries:
TimeEntries.createDirect()— POST to/TimeEntrieswithout parent scopeTimeTrackingClient.createRegularTimeEntry()— creates Regular 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)Key Autotask API discoveries documented in code
internalBillingCodeID(NOTbillingCodeID)useType=3are valid for Regular Time categories (Internal Meeting, Training, PTO, etc.)timeEntryType=5(Activity) is required for Regular Time{itemId: N}for creates, not{id: N}Relation to PR #153
This PR is a clean rebase of PR #153 by @shaank0 onto
main, keepingmain's correct gzip compression implementation (rather than removing gzip support entirely).Test 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