tinoji / rundeck-json-webhook-plugin

A Rundeck Plugin to POST JSON to webhook URLs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue trying to using ${option.values}

G3NSVRV opened this issue · comments

Hello,
I'm Jonathan from Rundeck support. I wanna report a wrong behaviour on this plugin using Rundeck 3 (latest 3.0.22) which is not taking the $[option.values} to be used as POST with webhook json plugin. Please advice.

e.g.

POST /ob/?ExecutionID=393555&EventID=${option.eventid}&ExecutionStatus=success HTTP/1.1
Content-Type: application/json
User-Agent: Java/1.8.0_121
Host: api.company.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 5965

.....

","notif_email":"hidden@email","git_branch":"master","ansible_ssh_user":"ansible","ansible_vault":"W %$(HrV$\u003e","playbook":"site.yaml"}}},"trigger":"success","config":{"webhookURL":"https://api.company.com/ob/?ExecutionID\u003d393555\u0026EventID\u003d${option.eventid}\u0026ExecutionStatus\u003dsuccess"}}

@G3NSVRV
Thanks for your report! I'll check if it could be fixed 👀

@G3NSVRV
Hmm... 🤔
It seems that the parse of option values works well in version 3.0.23-20190619.

Webhook URL:
Screen Shot 2019-08-03 at 19 05 05

Option values:
Screen Shot 2019-08-03 at 19 18 26

Webhook request dump:

--> POST /?id=212a4997-31f1-442b-bb42-df5422b78acf&val1=bar&val2=1234 HTTP/1.1
--> Content-Type: application/json
--> User-Agent: Java/1.8.0_191
--> Host: 192.168.1.3:3000
--> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
--> Connection: keep-alive
--> Content-Length: 1237
-->
-->
[socket#17] event: data
--> {"execution":{"id":21,"href":"http://127.0.0.1:4440/project/test01/execution/follow/21","status":"running","user":"admin","dateStarted":"Aug 3, 2019 10:02:33 AM","dateStartedUnixtime":1564826553990,"dateStartedW3c":"2019-08-03T10:02:33Z","description":"","argstring":"-val1 bar -val2 1234","project":"test01","loglevel":"INFO","job":{"id":"212a4997-31f1-442b-bb42-df5422b78acf","href":"http://127.0.0.1:4440/project/test01/job/show/212a4997-31f1-442b-bb42-df5422b78acf","name":"test1","group":"","schedule":"","project":"test01","description":"","averageDuration":1601},"context":{"globals":{},"job":{"successOnEmptyNodeFilter":"false","executionType":"user","wasRetry":"false","user.name":"admin","project":"test01","threadcount":"1","url":"http://127.0.0.1:4440/project/test01/execution/follow/21","execid":"21","serverUUID":"a14bc3e6-75e8-4fe4-a90d-a16dcc976bf6","serverUrl":"http://127.0.0.1:4440/","loglevel":"INFO","name":"test1","retryInitialExecId":"0","id":"212a4997-31f1-442b-bb42-df5422b78acf","retryAttempt":"0","username":"admin"},"option":{"val2":"1234","val1":"bar"}}},"trigger":"start","config":{"webhookURL":"http://192.168.1.3:3000/?id\u003d212a4997-31f1-442b-bb42-df5422b78acf\u0026val1\u003dbar\u0026val2\u003d1234"}}

@G3NSVRV
I'll close this issue. Please reopen if you still have problems.