Splunk SOAR (f.k.a. Phantom)

Playbook run results in the "user parameter must be of type string" error

kevinh_splunk
Splunk Employee
Splunk Employee
This article describes a workaround when you run a playbook and see the "user parameter must be of type string" error, but the parameter is a string.
 

An example of this error is shown below:

TypeError: Error in phantom.prompt(): user parameter must be of type string

An example call that generates this error is shown below:

phantom.prompt(user="support", message="Verify incident details", respond_in_mins=30, name="prompt_1", callback=prompt_1_callback)

The issue can be caused by an import that changes what is considered a string, such as:

import unicode_literals

To resolve the issue, specify that the string values are strings using str(). For example:

phantom.prompt(user=str("support"), message=str("Verify incident details"), respond_in_mins=30, name=str("prompt_1"), callback=prompt_1_callback)
Labels (1)
Tags (2)
0 Karma
Get Updates on the Splunk Community!

Check out This Month’s Brand new Splunk Lantern Articles

Splunk Lantern is a customer success center providing advice from Splunk experts on valuable data insights, ...

Happy CX Day to our Community Superheroes!

Happy 10th Birthday CX Day!What is CX Day? It’s a global celebration recognizing innovation and success in the ...

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...