HTTP request from Jira to Logic App not working, but same json from Postman work - json

I`m trying to build a Logic app on Azure which will receive JSON from Jira and do some magic on the Azure side. I created a button in Jira flow, which will trigger a webhook to Azure App Logic address. In App Logic I had a step called "When HTTP trigger is received". For schema creation I used the JSON from Jira, so the schema should be okay.
The problem is working with the input. In raw file I can see whole JSON with all details and properties, but it's not divided in to variables automatically.
Step output directly from JIRA
Output from Postman
The headers are more or less the same, so that shouldn't be a problem. Without this output I can't work with variables from JSON correctly, because when I will use variables name from Dynamic Menu it will be null (or "")

Related

Logic App dynamic content give null or ""

I want to create small automation between Jira and Azure. To do this, I execute HTTP trigger from Jira, which send all request properties to Azure Logic App. In "When a HTTP request is received" step in Logic App I can see properly JSON schema with all data which I need. In next steps for example I want to add user to Azure AD group. And problem starts here.
For example, I want to Initialize variable and set it with value from JSON. I choose properties from dynamic menu, but after script execute always it is null value ( but in first step in "raw output" I see whole schema with data). I tried many things - parse, compose, many different conversion - always without any luck - null value or "".
Expected value - when I want to initialize variable using Properties from Dynamic Content I want to have value from input json.
Output from Jira
Output with the same JSON send from Postman
Thanks for any help !
--
Flow example
Flow result
If you send the json with application/json content-type, you could just select the property with the dynamic content, however if not you have to parse it to json format with Parse Json action.
AS for the schema, you need use your json data to generate it with Use sample payload to generate schema. Paste the sample json payload.
Then you will be able to select property. However you could not implement it dynamic content, you have to write the expression. The format will be like this body('Parse_JSON')['test1'] and if your json has array data, you need to point the index it will be like this body('Parse_JSON')['test2'][0]['test3'].
Below is my test, you could have a try.

Retrieve values from a nested response in Postman

I am using postman to get certain responses. Below is my response.
Here I have some other api request links integrated with this response. Is there any possibility that I can get values inside these apis also. Its like retrieve values forom both parent api request and child api request.
I know this is possible using a java code. But is there any other exsiting software that I can use for this?
In your case I would recommend combining multiple requests into a chain or even a workflow. The idea is to have the first request fetch href endpoints that get called in subsequent requests. For that, the initial request needs a post-request test script that reads the href values from the response and stores it in a environment or global variable.
Like so:
// persist project href for next request
pm.environment.set("projectUrlPath", pm.response.json().embedded.elements[0]._links.project.href);
Your next request in the line would than use this variable to build the request url. Like so:
http://www.example.com{{projectUrlPath}}
The key is to correctly navigate to the right attribute in the response json JavaScript object. This online tool might help you with that:
https://www.w3schools.com/js/tryit.asp?filename=tryjs_json_parse

How can I receive JSON data from a API in same django project without using other module or library?

I have a API defined in my project which returns JSON data in response.
url(r'^api/report/(?P<report_id>\w+)/generate/', staff_member_required(api_views.GenerateReport.as_view()), name="generate_report"),
In another app of same project, I want to receive this data in views.py
How do I make a request to this url using some django functions.
I think there might be some way to make this GET request without using requests or any other 3rd party module.
Any help would be appreciated.

What is the specific type of the JSON being sent to a Webhook?

I can register a so called webhook in JIRA if I want JIRA to inform an external application about changes. Some JSON is generated when an issue is changed and sent to the webhook.
Is this JSON ...just a Stirng...or is it the representation of a specific Java class? If this would be the case: which class is it?
Or: how to I have to handle this JSON when it is sent to my SpringBoot application (webhook)? Just as a String or can I map this JSON via Jackson to a particular class...and how do I have to do this?
A callback for an issue-related event is structured like this...

Call rest service that returns JSON in mule esb?

How to call a rest service that returns JSON in a APIKit based message flow. I want to prepare the request for Rest service and want to extract the JSON message in a message flow.
Can any one help me to do this?
Thanks
The recommended way to invoke/consume REST services in mule is the use of HTTP Request
Do let us know if there is a specific you are facing
The request connector is especially handy when consuming a RESTful API
that is described in a RAML file. If you reference the API's RAML file
in the connector's configuration, it will proactively offer you the
set of available resources and operations contained in the RAML file,
as well as enforce the policies described in the file. It will also
expose the API metadata to Studio, which can then be used by other
elements such as DataWeave to autocomplete fields and make
configuration much easier
Use Rest URI path to invoke the Service and you can also get json response as output based on the type of service you invoke