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.
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()
$PSBoundParameters
$service_name
$service_input
Has anyone know if there is an endpoint to achieve this?
I think I've just found the answer! I was missing the $ :)