Repository navigation
fix(servicenow): read catalog item variables from the variables endpoint #22159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
michelle0927
merged 14 commits into
PipedreamHQ:master
from
srinivas56711:AGENTS-7047-servicenow-record-producer-variables
Oct 6, 2026
Merged
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cfc4175
fix(servicenow): read catalog item variables from the variables endpoint
f9ab7b0
chore(servicenow): only bump the action whose behavior changed
2cb01c3
Merge branch 'master' into AGENTS-7047-servicenow-record-producer-var…
diegoaad ab42190
chore(servicenow): bump every action that imports the app file
srinivas56711 e57e289
feat(servicenow): add Get Catalog Item and option guidance for catalo…
srinivas56711 580d7fd
fix(servicenow): address review on catalog variable option guidance
srinivas56711 a7e33cd
fix(servicenow): only strip a standalone EQ terminator from plain qua…
srinivas56711 c6962ca
fix(servicenow): read user_sys_id from the current_user session endpoint
srinivas56711 bd51f41
docs(servicenow): tell agents not to reimplement unresolved qualifier…
srinivas56711 deddc7c
refactor(servicenow): drop Get Catalog Item
srinivas56711 44cc982
docs(servicenow): clarify mandatory variables and unresolved defaults
srinivas56711 80a97e9
Merge branch 'master' into AGENTS-7047-servicenow-record-producer-var…
ashwins01 0f5936c
Merge branch 'master' into AGENTS-7047-servicenow-record-producer-var…
michelle0927 644b383
fix(servicenow): trim catalog variable output to the fields agents need
srinivas56711 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
60 changes: 60 additions & 0 deletions
60
components/servicenow/actions/get-catalog-item/get-catalog-item.mjs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import servicenow from "../../servicenow.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "servicenow-get-catalog-item", | ||
| name: "Get Catalog Item", | ||
| description: "Retrieve details for a ServiceNow catalog item or record producer: name, short and full description, price and recurring price, catalogs and categories, item type, whether an attachment is mandatory, and its catalog UI policies and client scripts. Run **Search Catalog Items** first to obtain the item `sys_id`. To build the `variables` payload for **Add Item to Cart**, **Order Catalog Item**, or **Submit Record Producer**, use **Get Catalog Item Variables**, which returns each form field with its valid options. [See the documentation](https://www.servicenow.com/docs/r/zurich/api-reference/rest-apis/c_ServiceCatalogAPI.html)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| ai: "optimized", | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| props: { | ||
| servicenow, | ||
| catalogItemSysId: { | ||
| propDefinition: [ | ||
| servicenow, | ||
| "catalogItemSysId", | ||
| ], | ||
| }, | ||
| includeVariables: { | ||
| type: "boolean", | ||
| label: "Include Variables", | ||
| description: "Set to `true` to also return the raw `variables` array. Leave unset to omit it; **Get Catalog Item Variables** returns the same fields with option guidance.", | ||
| optional: true, | ||
| default: false, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| let item; | ||
| try { | ||
| item = await this.servicenow.getCatalogItem({ | ||
| $, | ||
| catalogItemSysId: this.catalogItemSysId, | ||
| }); | ||
| } catch (error) { | ||
| if (error?.response?.status === 500) { | ||
| throw new ConfigurationError(`ServiceNow could not load the details of catalog item \`${this.catalogItemSysId}\` (HTTP 500). This happens for some record producers; run **Get Catalog Item Variables** to get its form fields.`); | ||
| } | ||
| throw error; | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| const result = { | ||
| ...item, | ||
| }; | ||
| if (!this.includeVariables) { | ||
| result.variable_count = Array.isArray(item?.variables) | ||
| ? item.variables.length | ||
| : 0; | ||
| delete result.variables; | ||
| } | ||
|
|
||
| $.export("$summary", `Successfully retrieved catalog item ${result.name ?? this.catalogItemSysId}`); | ||
|
|
||
| return result; | ||
| }, | ||
| }; | ||
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.