How to automatically import script content from the O.S. into a Jobs Object?

Discussion created by Daniel_Braaf_197 on Feb 12, 2016
Latest reply on Feb 13, 2016 by Daniel_Braaf_197
Every now and then i get asked if there is a possibility to import script from the O.S. to a Job within Automic?

V11.2 offers some really nice new features that makes it easier to build such an automation. 

Before i start however, a little advertising for my training i am holding soon, this will be one of the topics i will be covering, so if you like what you read here, please come join my training session. Here the link with more information:

So here are my scripts that i have locally on my Windows machine where i have an Automic Agent installed:


A powerhsell file, several SQL scripts, and 2 bat files. 

Here some example content they contain:


In Automic i have 3 File-Events that watch over my autoconvert folder that contains my scripts:



If the folder contains scripts, the following Win-Job is triggered (batch file import example):



The script reads the file content into a process loop, then forms it into one big Variable named &JCL# (thanks to Variable length enhancement in V11). The Variable is then resolved into a deployment of the xml of the Job wich is stored in a storage Object.

The Post Script of the job Imports the XML back into Automic:


If we now navigate into our import folder there was a job created for each script that was found:


Lets have a look into our Batch Script import Job:


Interpreter Script such as Powershell can be importet directly into the external interpreter section:


If you would rather have a function similar to an upload button, you can combine the Importjob with a prompset object


Hope this might be useful to some of you! Hope to see you in the training session!!