How to launch the Rest API method scripts with multiple lines
search cancel

How to launch the Rest API method scripts with multiple lines

book

Article ID: 260909

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

I would like to execute the REST API method scripts but sending several lines in the parameter script, how can we do this?.

 

For example I would like to launch two print statements like the following:

:PRINT ‘TUTU’
:PRINT ‘TATA’

Environment

Release : 12.3.x and 21.x

Component: Automation Engine

Functional Area: Rest API scripts

Cause

Example on the documentation does not show how to pass multiple lines.

Resolution

In order to pass several lines to the script parameter you need to use the blank followed by \n at the end of each line, as below:

{"script"":PRINT 'TUTU' \n:PRINT 'TATA' ","queue":"CLIENT_QUEUE" }
 
In that case, the activation report will show:
2023-02-27 17:06:17 - U00020408 TUTU
2023-02-27 17:06:17 - U00020408 TATA