AIOps

 View Only

 Cloud Pak for AIOps – REST Parameters Not Exposed to Action Scripts

Anthony Baden Harden Torres's profile image
Anthony Baden Harden Torres posted 04/07/26 06:02 PM

I ran into an issue while invoking an Automation Action (script type) via REST API in Cloud Pak for AIOps where parameters sent in the request were not being exposed to the PowerShell script at runtime.

Problem

API: /aiops/api/story-manager/rba/v1/actioninstances?actionId={{action_id}}

A REST payload like:

{
  "parameters": [
    { "name": "service_name", "value": "edgeupdate" },
    { "name": "service_action", "value": "status" }
  ]
}

successfully triggers the action, but inside the script:

  • param() inputs are null
  • $PSBoundParameters is empty
  • no corresponding variables (e.g. $service_name, $service_input) are populated
  • no environment variables are present either

Has anyone know if there is an endpoint to achieve this?

Anthony Baden Harden Torres's profile image
Anthony Baden Harden Torres

I think I've just found the answer! I was missing the $ :)

{
  "parameters": [
    { "name": "$service_input", "value": "edgeupdate" },
    { "name": "$service_action", "value": "all" }
  ]
}