Skip to content

Commit c4d8e21

Browse files
Update JEC integration script (#3)
1 parent fc90245 commit c4d8e21

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

jec/conf/jec-config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"apiKey": "<API_KEY>",
3-
"baseUrl": "https://api.opsgenie.com",
3+
"baseUrl": "https://api.atlassian.com",
44
"logLevel": "DEBUG",
55
"globalArgs": [
66
"<list_of_args_you_want_to_pass_to_the_scripts>"
77
],
88
"globalFlags": {
99
},
1010
"actionMappings": {
11-
"Create": {
11+
"postActionToJEC": {
1212
"filepath": "<path_of_script>",
1313
"sourceType": "<local | git>",
1414
"env": [

jec/scripts/jec_action_executor.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
print("This is an example script. You can write your custom scripts!")
1+
import argparse
2+
import json
3+
4+
parser = argparse.ArgumentParser()
5+
parser.add_argument('-payload', '--payload', help='Payload from queue', required=True)
6+
7+
args, unknown = parser.parse_known_args()
8+
args = vars(args)
9+
10+
queue_message_string = args['payload']
11+
queue_message = json.loads(queue_message_string)
12+
13+
print(queue_message)

0 commit comments

Comments
 (0)