Add TeamDynamix v1 for Education ITSM - #110
Conversation
Introduce TeamDynamix v1 plugin: adds metadata, UI, config validation, index definitions, icons and README. Adds comprehensive dataStreams (tickets, assets, configurationItems, projects, services, KB articles, timeEntries, locations, accounts, groups, applications, ticketStatuses, currentUser) plus post-request scripts to project/flatten results. Implements preRequest.js for BEID/WebServicesKey authentication, token caching, request spacing and rate-limit handling, and a shared error-handling script. Includes default dashboards, scopes, and custom type definitions for out-of-the-box monitoring.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
📝 WalkthroughWalkthroughAdds a TeamDynamix v1 plugin with authenticated API access, configuration validation, discovery and operational data streams, indexed objects, custom types, default scopes, dashboards, and setup documentation. ChangesTeamDynamix integration
Sequence Diagram(s)sequenceDiagram
participant Dashboard
participant DataStream
participant preRequest
participant TeamDynamixAPI
Dashboard->>DataStream: request filtered records
DataStream->>preRequest: submit API request
preRequest->>TeamDynamixAPI: authenticate and send request
TeamDynamixAPI-->>DataStream: return API response
DataStream-->>Dashboard: return normalized records
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.6)plugins/TeamDynamix/v1/preRequest.jsFile contains syntax errors that prevent linting: Line 84: Illegal return statement outside of a function; Line 93: Illegal return statement outside of a function Comment |
There was a problem hiding this comment.
Actionable comments posted: 12
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/TeamDynamix/v1/dataStreams/configurationItems.json`:
- Around line 9-13: Update the configurationItems stream around endpointPath,
postBody, and paging so it applies a supported server-side CMDB response bound
before enabling the stream. Do not add an unsupported MaxResults field; use an
API-supported filter or disable the stream for tenants that cannot guarantee a
safe response size.
In `@plugins/TeamDynamix/v1/dataStreams/projects.json`:
- Around line 79-81: Remove decimalPlaces and thousandsSeparator from the
numeric metadata shapes in plugins/TeamDynamix/v1/dataStreams/projects.json
lines 79-81, leaving the budget fields as raw number shapes; apply the same
change to the hours, bill rate, and cost rate fields in
plugins/TeamDynamix/v1/dataStreams/timeEntries.json lines 48-60. Configure
presentation formatting only in the corresponding dashboard columns.
In `@plugins/TeamDynamix/v1/dataStreams/scripts/configurationItems.js`:
- Around line 9-13: Update the configuration item transformation that uses
BACKING_ITEM_TYPE_NAMES to preserve the upstream numeric BackingItemType,
emitting item.BackingItemType ?? null instead of a mapped label or empty string.
Change the corresponding configurationItems.json field definition to shape
"number", leaving presentation labels to dashboard formatting.
In `@plugins/TeamDynamix/v1/dataStreams/scripts/services.js`:
- Around line 4-11: Update
plugins/TeamDynamix/v1/dataStreams/scripts/services.js lines 4-11 and
plugins/TeamDynamix/v1/dataStreams/scripts/projects.js lines 6-13 so
customAttributeColumns receives records containing Attributes from a supported
detail endpoint before generating attr.* projections; alternatively remove the
attr.* projections and related metadata in both files. Ensure the selected
approach applies consistently to both service and project streams.
In `@plugins/TeamDynamix/v1/dataStreams/scripts/tickets.js`:
- Around line 35-43: Update the webBaseUrl normalization and ticketLink
construction to capture whether the source URL uses the sandbox TDWebApi prefix,
then reuse that prefix when selecting the deep-link application path. Production
URLs must continue using /TDNext, while sandbox URLs use /SBTDNext instead of
losing the sandbox segment.
- Around line 55-95: Update the ticket mapping flow to verify that data is an
array before calling .map. For non-array response bodies, use the existing
empty-result behavior instead of attempting to map the object, while preserving
normal mapping for valid array responses.
In `@plugins/TeamDynamix/v1/dataStreams/tickets.json`:
- Around line 126-129: Update the TeamDynamix stream configuration’s
defaultTimeframe value from last30days to dashboard, preserving the existing
timeframes and supportsNoneTimeframe settings so the dashboard timeframe
controls the actual window.
In `@plugins/TeamDynamix/v1/dataStreams/ticketStatuses.json`:
- Line 26: Update the StatusClass field declaration in the ticket status schema
to use shape "number", matching the integer enum returned by the unscripted
response passthrough. Do not add a projection or change the field’s visibility.
In `@plugins/TeamDynamix/v1/dataStreams/timeEntries.json`:
- Around line 66-68: Update the timeEntries timeframe configuration to replace
the unsupported defaultTimeframe value "last30days" with the supported value
"dashboard" or "none", while preserving the existing timeframes and
supportsNoneTimeframe settings.
In `@plugins/TeamDynamix/v1/docs/README.md`:
- Line 23: Update the “Ignore certificate errors” description in the
documentation table to state that it should be enabled only when the API
endpoint presents a self-signed or otherwise untrusted certificate, and remove
the implication that self-hosted instances inherently require it.
In `@plugins/TeamDynamix/v1/indexDefinitions/default.json`:
- Around line 21-22: Remove the “TeamDynamix ” prefix from source-type
identifiers such as the value in the default index definition, and update all
consumers in custom_types.json, metadata.json, index mappings, scopes, stream
matches, and producing scripts to use the upstream names. Preserve prefixed
custom-type values only where they serve as friendly display names. Create a new
major-version directory while retaining v1 unchanged, and update the new
metadata version accordingly.
In `@plugins/TeamDynamix/v1/ui.json`:
- Around line 15-18: Update the apiBaseUrl pattern validation to reject URLs
containing query (?) or fragment (#) components while continuing to accept valid
HTTPS host and path values. Preserve the existing full-address validation and
message behavior in the pattern configuration.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2c76d4d2-7dbe-4bdb-aa1a-e3506d63eb14
⛔ Files ignored due to path filters (2)
plugins/TeamDynamix/v1/icon.pngis excluded by!**/*.pngplugins/TeamDynamix/v1/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (35)
plugins/TeamDynamix/v1/configValidation.jsonplugins/TeamDynamix/v1/custom_types.jsonplugins/TeamDynamix/v1/dataStreams/accounts.jsonplugins/TeamDynamix/v1/dataStreams/applications.jsonplugins/TeamDynamix/v1/dataStreams/assets.jsonplugins/TeamDynamix/v1/dataStreams/configurationItems.jsonplugins/TeamDynamix/v1/dataStreams/currentUser.jsonplugins/TeamDynamix/v1/dataStreams/groups.jsonplugins/TeamDynamix/v1/dataStreams/knowledgeBaseArticles.jsonplugins/TeamDynamix/v1/dataStreams/locations.jsonplugins/TeamDynamix/v1/dataStreams/projects.jsonplugins/TeamDynamix/v1/dataStreams/scripts/accounts.jsplugins/TeamDynamix/v1/dataStreams/scripts/applications.jsplugins/TeamDynamix/v1/dataStreams/scripts/assets.jsplugins/TeamDynamix/v1/dataStreams/scripts/configurationItems.jsplugins/TeamDynamix/v1/dataStreams/scripts/errorHandling/rateLimit.jsplugins/TeamDynamix/v1/dataStreams/scripts/knowledgeBaseArticles.jsplugins/TeamDynamix/v1/dataStreams/scripts/locations.jsplugins/TeamDynamix/v1/dataStreams/scripts/projects.jsplugins/TeamDynamix/v1/dataStreams/scripts/services.jsplugins/TeamDynamix/v1/dataStreams/scripts/tickets.jsplugins/TeamDynamix/v1/dataStreams/services.jsonplugins/TeamDynamix/v1/dataStreams/ticketStatuses.jsonplugins/TeamDynamix/v1/dataStreams/tickets.jsonplugins/TeamDynamix/v1/dataStreams/timeEntries.jsonplugins/TeamDynamix/v1/defaultContent/assetsDashboard.dash.jsonplugins/TeamDynamix/v1/defaultContent/manifest.jsonplugins/TeamDynamix/v1/defaultContent/overviewDashboard.dash.jsonplugins/TeamDynamix/v1/defaultContent/scopes.jsonplugins/TeamDynamix/v1/defaultContent/serviceDeskDashboard.dash.jsonplugins/TeamDynamix/v1/docs/README.mdplugins/TeamDynamix/v1/indexDefinitions/default.jsonplugins/TeamDynamix/v1/metadata.jsonplugins/TeamDynamix/v1/preRequest.jsplugins/TeamDynamix/v1/ui.json
Remove the defaultTimeframe property from tickets and timeEntries data stream configurations. The timeframes feature is still supported, allowing consumers to handle timeframe defaults independently.
Enforce a client-side cap for the Configuration Items data stream and clarify the limitation in docs. The script now collects rows, sorts by modifiedDate (newest first) and slices to the plugin's "Maximum records per request" (context.dataSources[0].maxRecords, default 2000) to avoid exceeding the ~6MB stream response limit because the TeamDynamix CMDB search has no maxResults or usable paging. README updated to explain the lack of paging, the plugin's workaround, and guidance to filter to Active or lower the cap if needed.
Remove dynamic `attr.*` custom-attribute columns from TeamDynamix data streams and metadata. The scripts no longer build or spread customAttributeColumns and the JSON metadata patterns matching `^attr\..*` were removed because TeamDynamix search endpoints do not return Attributes/Attachments (only individual record loads do). README updated to document that custom attributes are not available without per-record detail calls. Affected files: assets, tickets, services, projects, configurationItems (scripts + JSON) and docs/README.md.
Detect SBTDWebApi base URLs and derive the matching sandbox web app when building record links. Update assets, configurationItems, knowledgeBaseArticles and tickets scripts to use a rawBaseUrl/isSandbox check and choose SBTDNext/TDNext or SBTDClient/TDClient as appropriate. Trim trailing slashes as before and fall back to record Uri when no base URL is available. Update plugin README to document that sandbox web paths are inferred and unverified.
Replace usages of (data || []) with Array.isArray(data) ? data : [] across TeamDynamix data stream scripts to ensure .map is only called on arrays and avoid runtime errors when the API returns non-array or null values. Updated files: accounts.js, applications.js, assets.js, configurationItems.js, knowledgeBaseArticles.js, locations.js, projects.js, services.js, tickets.js.
Set defaultTimeframe to 'dashboard' for the TeamDynamix tickets and timeEntries data streams so dashboards use the dashboard timeframe when none is specified. Preserves existing timeframes and supportsNoneTimeframe settings.
Update ticketStatuses.json to use a numeric shape for StatusClass. Update timeEntries.json to use a numeric shape for Component and add a formatExpression that maps common numeric component codes to human-readable labels (with a fallback to the raw value). These changes align shaping with API types and improve display of component values.
Patch release for TeamDynamix plugin.
Update README and UI help text to clarify that the "Ignore certificate errors" option should only be enabled when the Web API endpoint presents a self-signed or otherwise untrusted certificate. Also note that self-hosted instances can still have properly trusted certificates and therefore typically do not need this option. Files updated: plugins/TeamDynamix/v1/docs/README.md, plugins/TeamDynamix/v1/ui.json.
Update the URL validation pattern to prevent invalid formats including query parameters, fragments, and authentication credentials. The new pattern uses a non-capturing group and explicitly excludes @, ?, and # characters to ensure valid TeamDynamix Web API URLs.
Simplify account terminology across TeamDynamix plugin by removing '/ Departments' suffix from account display names and labels in custom types, data streams, and documentation.
Delete plugins/TeamDynamix/v1/icon.png and modify plugins/TeamDynamix/v1/icon.svg. The SVG was cleaned up (removed the white background <rect> and adjusted defs/order) so it can be used as a transparent, single vector asset instead of keeping a raster PNG. This reduces redundancy and keeps the icon scalable.
Transfer plugin ownership from SquaredUp Labs to community maintainer @shawn149. Update metadata to reflect community-maintained status.
Remove the preRequest request-spacing logic and state tracking from plugins/TeamDynamix/v1/preRequest.js and update docs to match. The script no longer enforces a minimum gap or updates state.lastRequestAt (sleep/minGap logic removed); comments explain rate limiting is handled by the platform and the stream-level rateLimit.js handler. plugins/TeamDynamix/v1/docs/README.md wording updated to reflect that the plugin does not pace requests and throttled tiles recover on the next refresh.
Remove the introductory markdown section from the TeamDynamix v1 UI configuration that contained setup instructions and permission requirements.
🧩 Plugin PR Summary📦 Modified Plugins
📋 Results
🔍 Validation Details✅
|
Introducing the TeamDynamix plugin (v1)
🔌 Plugin overview
POST /api/auth/loginadmin. No built-inauthModecovers a token exchange, so this runs in a pre-request script that caches the token against its ownexpclaim.🖼️ Plugin screenshots
Plugin configuration
pending customer test
Default dashboards
pending customer test
🧪 Testing
I have no TeamDynamix instance and no credentials, so nothing here has been tested end to end against a live back end. A customer has agreed to be the first test. I have tried to make that first run as informative as possible rather than pretend the gap isn't there.
Unit tests. Since I could not test streams against real data, I wrote offline checks.
Nothing has been tested against a live TeamDynamix instance.
Five assumptions can only be settled by a real tenant:
loginadminreturns the token as raw text or as a JSON-quoted string. The script strips optional surrounding quotes so it handles both, but only one has ever been observed./SBTDWebApi. This is inferred, not confirmed, and the field help says so.OrgApplication.Typereturns exactlyTicketingandAssets/CIon a real tenant. These values are documented in the spec and they are what split applications into the three object types, so if a tenant reports something else the object pickers will be wrong.scope.queryonsourceTyperesolves as expected for the dependent asset and configuration item import steps. Both are markedoptional, so a miss degrades to a warning instead of failing the whole import.The API has no pagination, so results are capped. This is a genuine TeamDynamix constraint. The
/searchendpoints return a single unpaged result set with only aMaxResultscap, and paged access exists only through saved searches.ConfigurationItemSearchhas no cap parameter at all, which makes the Configuration Items tile the most likely thing to fail on a large estate. Defaults are 2000 records, configurable per tile, and this is documented in the README.Tickets are not imported into the graph. They are high-volume transactional records rather than infrastructure, so they are queried live through the Tickets data stream instead. People are not imported either, for volume and PII reasons.
Wide records are trimmed. A TeamDynamix ticket has 119 fields including the full HTML description plus attachment and task arrays. Passing those through overruns the response size cap at a few hundred rows, so the scripts project to a dashboard-usable column set. Ticket descriptions, attachments and task detail are therefore not available. Custom attributes are flattened into
attr.-prefixed columns, hidden by default.Time entries identify people by UID. The time search returns a person's unique identifier and no name field, so time cannot be grouped by person name.
Follow-ups. Report Builder (
/api/reports) is not implemented, since it depends on reports a customer may not have. Attachments, feeds, ticket tasks, and project plans, issues and risks are all out of scope for v1. Once the customer confirms the five assumptions we might revisit whether projects, services and knowledge base articles should be imported as objects rather than left as application-scoped streams.📚 Checklist
Summary by CodeRabbit
Summary by CodeRabbit