Skip to content

Move ServiceNow choice values to shared and add state fields helper#2316

Open
ravikiranvm wants to merge 2 commits into
ops-4414from
ops-4424
Open

Move ServiceNow choice values to shared and add state fields helper#2316
ravikiranvm wants to merge 2 commits into
ops-4414from
ops-4424

Conversation

@ravikiranvm
Copy link
Copy Markdown
Contributor

Moves getServiceNowChoiceValues from the ServiceNow block into @openops/common so it can be reused across packages, and adds getServiceNowStateFields — 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-internal that lets users pick which ServiceNow field to read ticket state from.

Changes

  • packages/openops/src/lib/servicenow/get-choice-values.ts — moved from packages/blocks/servicenow/src/lib/.
  • packages/openops/src/lib/servicenow/get-state-fields.ts — new. Filters by internal_type in choice or integer, reuses getServiceNowTableFields for the parent-hierarchy walk.
  • packages/blocks/servicenow/src/lib/create-field-value-property.ts — now imports from @openops/common.
  • Tests updated/moved accordingly.

Stacking

Stacked on top of #2312 because getServiceNowStateFields depends on the parent-hierarchy walk added there. Rebase to main once #2312 merges.

- 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>
@linear
Copy link
Copy Markdown

linear Bot commented May 29, 2026

OPS-4424

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant