cartJS API を使用してアイテムを注文すると、想定どおりに機能しません。Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } カスタム買い物かご注文からアイテムを注文しようとしましたが、デフォルトの買い物かごからのすべてのアイテムが注文されています。 Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } London 以前 Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } これはプラットフォームの不具合であり、PRB1297366で対処されています。 Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } OOB order_now API (api/sn_sc/servicecatalog/items/{sys_id}/order_now) は、1 つのアイテムのみを注文するように設計されています 複数のアイテムを注文する場合は、チェックアウト (/api/sn_sc/servicecatalog/cart/checkout) または注文の送信 (/api/sn_sc/servicecatalog/cart/submit_order) を使用する必要があります。 しかし現在、チェックアウトまたは送信注文を使用して複数のアイテムを注文し、この問題に対するPRB1297366が作成され、問題がテストステータスにある場合、カスタム買い物かごではなくポータルカートからすべてのアイテムを注文するプラットフォームにバグがあります。 そのため、回避策として、カスタム Web サービスを作成し、SN 以外のアプリで使用できます。 回避策: 1.現在のアプリケーションスコープを「サービスカタログ REST API」(OOB order_nowスクリプト API が存在するスコープと同じ) に変更してください 2.フィルターナビゲーターに「スクリプト済み REST API」と入力し、[システム Web サービス] の下にある [スクリプト済み REST API] を選択します 3.「サービスカタログ API」という名前のレコードを開きます 4.下部の [Resources] セクションで、「Buy Item」という名前のレコードを別のタブで参照用に開きます。 5.[リソース] セクションに戻り、[新規] をクリックします 6.フィールドに次の値を指定します。 名前:<希望する名前> (例) カスタム 今すぐ注文 API バージョン:v1 [HTTP メソッド]: POST 相対パス:/items/{sys_id}/<希望する名前> (例) /items/{sys_id}/custom_order_now 7.スクリプトセクションで、次のコードを貼り付けます。 (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { // implement resource here var request_body = request.body.nextEntry(); var quantity = '' + request_body.sysparm_quantity; var noValidation = (request_body.sysparm_no_validation == 'true'); var cartName = request_body.sysparm_cart_name; if (!/^\+?([0-9]*)$/.test(quantity)) throw new sn_ws_err.BadRequestError("Invalid Quantity value"); else request_body.sysparm_quantity = quantity; var itemId = '' + request.pathParams.sys_id; request_body.sysparm_id = itemId; var catItem = new sn_sc.CatItem(itemId); if (!catItem.canView()) throw new sn_ws_err.BadRequestError("Security constraints prevent ordering of Item"); if(!noValidation) { var catUtil = new RestCatalogUtil(); if (!catUtil.checkMandatoryVariables(itemId, request_body.variables)) throw new sn_ws_err.BadRequestError('Mandatory Variables are required'); } var cart; //If cartName is undefined then it will be falsy if(cartName){ cart = new sn_sc.CartJS(cartName); }else{ cart = new sn_sc.CartJS("cart_" +itemId); request_body.sysparm_cart_name = "cart_" +itemId; } try { return cart.orderNow(request_body); }catch(e) { gs.debug(e); throw new sn_ws_err.NotFoundError("Invalid Request"); } })(request, response); 8.レコードを保存します これで、カスタムスクリプト API が REST エクスプローラーの API リストに表示され、カスタム買い物かごからすべてのアイテムが注文されます。 このオブジェクト {"sysparm_quantity":"1","get_portal_messages":"true","sysparm_cart_name":"JJ1234"} が要求本文に含まれていることを確認してください。