Code Monkey home page Code Monkey logo

Comments (6)

tomasbjerre avatar tomasbjerre commented on May 18, 2024

Released in 1.22.

To just use the expression $ and there will be a variable containing all JSON.

Open issue again if not working.

from generic-webhook-trigger-plugin.

anilkumars avatar anilkumars commented on May 18, 2024

Thanks tomasbjerre for quick reply,

I tried Version 1.23:

Used $ in expression, but didnt see any contributing variables.

Thanks,
Anil

from generic-webhook-trigger-plugin.

tomasbjerre avatar tomasbjerre commented on May 18, 2024

from generic-webhook-trigger-plugin.

anilkumars avatar anilkumars commented on May 18, 2024

Hi Tomas,

Thanks for quick reply.

Curl Command like below:
curl -u "admin:admin" -H "Content-Type: application/json" -X POST -d '{
  "search_name":"Test",
  "owner": "service_virtual_infrastructure",
  "result":    {
      "event_time": "Oct  9 15:04",
  },
"test": "Test"
}' http://localhost:8080/generic-webhook-trigger/invoke?token=ulnet_remediation

Jenkins Job Configuration like below:

Variable test

Expression $

Thanks,
Anil

from generic-webhook-trigger-plugin.

tomasbjerre avatar tomasbjerre commented on May 18, 2024

You have some invalid characters and an extra , at the end of the line event_time.

This works for me:

curl -u "admin:admin" -H "Content-Type: application/json" -X POST -d '{
 "search_name": "Test",
 "owner": "service_virtual_infrastructure",
 "result":     {
  "event_time": "Oct  9 15:04"
 },
 "test": "Test"
}'  http://localhost:8080/generic-webhook-trigger/invoke?token=ulnet_remediation

In the log I see:

GenericWebhookEnvironmentContributor Received:

{
 "search_name": "Test",
 "owner": "service_virtual_infrastructure",
 "result":     {
  "event_time": "Oct  9 15:04"
 },
 "test": "Test"
}


Contributing variables:

    test_search_name = Test
    test = {"search_name":"Test","owner":"service_virtual_infrastructure","result":{"event_time":"Oct  9 15:04"},"test":"Test"}
    test_result_event_time = Oct  9 15:04
    test_owner = service_virtual_infrastructure
    test_test = Test

from generic-webhook-trigger-plugin.

anilkumars avatar anilkumars commented on May 18, 2024

Thanks Much Tomas,

It worked after correcting the input Json as per your suggestion.
Appreciate your help.

I see same log message:

{
"search_name": "Test",
"owner": "service_virtual_infrastructure",
"result": {
"event_time": "Oct  9 15:04"
},
"test": "Test"
}

Contributing variables:

test_search_name = Test
test = {"search_name":"Test","owner":"service_virtual_infrastructure","result":{"event_time":"Oct  9 15:04"},"test":"Test"}
test_result_event_time = Oct  9 15:04
test_owner = service_virtual_infrastructure
test_test = Test

from generic-webhook-trigger-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.