Move ServiceNow choice values to shared and add state fields helper#2316
Open
ravikiranvm wants to merge 2 commits into
Open
Move ServiceNow choice values to shared and add state fields helper#2316ravikiranvm wants to merge 2 commits into
ravikiranvm wants to merge 2 commits into
Conversation
- Move getServiceNowChoiceValues / ServiceNowChoice from the ServiceNow block into @openops/common so it can be reused across packages. The blocks-level file is removed and its single consumer (create-field-value-property) now imports from @openops/common. - Add getServiceNowStateFields, a helper that returns the columns on a given table (including parent-table columns) that are usable as a status field (choice or integer with a layered sys_choice list). This is needed by upcoming campaign features that let users pick which ServiceNow field to read ticket state from. Stacked on top of #2312 because getServiceNowStateFields depends on the parent-hierarchy walk added there. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.



Moves
getServiceNowChoiceValuesfrom the ServiceNow block into@openops/commonso it can be reused across packages, and addsgetServiceNowStateFields— a helper that returns the columns on a given table (including parent-table columns) usable as a status field.Both are needed by an upcoming campaign feature in
openops-internalthat lets users pick which ServiceNow field to read ticket state from.Changes
packages/openops/src/lib/servicenow/get-choice-values.ts— moved frompackages/blocks/servicenow/src/lib/.packages/openops/src/lib/servicenow/get-state-fields.ts— new. Filters byinternal_typeinchoiceorinteger, reusesgetServiceNowTableFieldsfor the parent-hierarchy walk.packages/blocks/servicenow/src/lib/create-field-value-property.ts— now imports from@openops/common.Stacking
Stacked on top of #2312 because
getServiceNowStateFieldsdepends on the parent-hierarchy walk added there. Rebase tomainonce #2312 merges.