1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【ServiceNow】複数のナレッジ記事を一括で公開する方法

Last updated at Posted at 2025-03-28

1. はじめに

みなさんこんにちは、三井情報株式会社です。

今回は業務において既に作成済みのナレッジ記事を一括で「公開」する必要があったため、その方法を紹介します。

2. バックグラウンドスクリプトの実行

今回はナレッジベース=人事ナレッジの4つのナレッジ記事を一括で公開します。
image.png

1.「システム定義 > スクリプト:バックグラウンド」を開く。
2.以下のスクリプトを実行する。

var now_GR = new GlideRecord("kb_knowledge");
now_GR.addQuery("kb_knowledge_base", "(対象のナレッジベースのSysID)");
now_GR.query();

while (now_GR.next()) {
now_GR.setForceUpdate(true);
now_GR.setValue("workflow_state", "published"); // workflow_stateフィールドを更新
now_GR.update(); // レコードを更新
}

3.「ナレッジ > 記事 > すべて」から対象のナレッジベース(今回は「人事ナレッジ」)に絞り込む。
4.記事が全て「公開済み」となっていることを確認する。
image.png

3. まとめ

いかがでしたでしょうか。今回は、複数のナレッジ記事を一括で「公開」する方法について紹介しました。

最後までお読みいただき、ありがとうございました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?