ksc_run_command_in_other_requests

If a change of a request impacts its related requests, you can run this command in the request to trigger the running of any command of the related requests. This helps you apply the change to all related requests by running a single command.

Parameters

This command contains the following parameters:

Parameter Default token Description
REQUEST_IDS None. This is a required parameter.

IDs of the requests in which you want to run the specified command.

COMMAND_NAME None. This is a required parameter. Name of the command that you want to run in the specified requests.
CONTEXT_HIDDEN_VALUE [REQ.REQUEST_ID]

The hidden value that you want to pass to the specified requests.

CONTEXT_VISIBLE_VALUE [REQ.REQUEST_TYPE_NAME]

The visible value that you want to pass to the specified requests.

Back to top

Example

Suppose there is a request of the Feature request type, say F1. It includes two requests of the User Story request type, say US1 and US2.

Example 1

In US1 and US2, there is a Feature field to store the feature they belong to. When the name of F1 is updated, we want the new name to be reflected in US1 and US2.

To accomplish this, configure the following:

  1. In US1 and US2, add a command UPDATE FEATURE NAME, and configure the command as follows:

    • Event: Apply on call from external request

    • Command Steps:

      Copy code
      ksc_store FEATURE="[CONTEXT_HIDDEN_VALUE]","[CONTEXT_VISIBLE_VALUE]"
  2. In F1, add the run_commands_in_other_requests command and configure the command as follows to trigger the running of the UPDATE FEATURE NAME command in U1 and U2.

    • Event: Apply after save

    • Command Steps:

      Copy code
      ksc_run_command_in_other_requests REQUEST_IDS="[P.USER_STORY]" COMMAND_NAME="UPDATE FEATURE NAME" CONTEXT_HIDDEN_VALUE="[ REQ.REQUEST_ID]" CONTEXT_VISIBLE_VALUE="[P.FEATURENAME]"

Example 2

In F1, there is a Story Points field to store the story points rolled up from US1 and US2. When the story points of US1 and US2 are updated, we want F1 to recalculate its story points.

To accomplish this, configure the following:

  1. In F1, add a command UPDATE STORY POINTS, and configure the command as follows:

    • Event: Apply on call from external request

    • Command Steps:

      Copy code
      ksc_itg_run_sql QUERY_STRING="select nvl(sum(RD.PARAMETER1),0) from kcrt_request_details rd where RD.REQUEST_ID in ([P.USERSTORY])" EXCEPTION_OPTION="-no_data_exception"
      ksc_store STORYPOINT = [SQL_OUTPUT]
  2. In US1 and US2, add the run_commands_in_other_requests command and configure the command as follows to trigger the running of the UPDATE STORY POINTS command in F1:

    • Event: Apply after save

    • Command Steps:

      Copy code
      ksc_run_command_in_other_requests COMMAND_NAME="UPDATE STORY POINTS" REQUEST_IDS="[P.FEATURE]"

See also: