Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I use arguments in as script for the OEC

connor mcguane September 22, 2020

I am writing a powershell script to be called by the OEC.   In the config.yml file, I see the globalArgs line, but I dont know if these are specified by me, or is there a set of acceptable terms.  How are these arguments then accessed within my powershell script?  Finally, is there anything I need to configure in the tool, on the OEC integration page?

1 answer

0 votes
Allen Barnard
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 28, 2020

Hi Connor,

 

Sorry for the delayed response, firstly I should mention that passing args is not the optimal way to pass data from OEC to the PowerShell scripts, rather use "globalFlags" to declare key value pairs that are passed to PowerShell as named parameters with corresponding values.

 

Here is an example of how to set 3 parameters in config.yml:

 

apiKey: xxxxx-xxxxxxxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxx
baseUrl: https://api.opsgenie.com
logLevel: debug
globalFlags:
parameter1: value1
parameter2: value2
parameter3: value3
actionMappings:
...
...

 

Here is an example of how to use these parameters in PowerShell:

 

param([string]$payload,
      [string]$apiKey,
      [string]$opsgenieUrl,
      [string]$logLevel,
      [string]$parameter1,
      [string]$parameter2,
      [string]$parameter3
)

echo $parameter1
echo $parameter2
echo $parameter3

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events