0
votes

I am currently using the "When an HTTP request is received" trigger, and the "Create Work Item In Azure Dev Ops" action.

The use case here is to receive a JSON payload from DeskPro using their webhooks, and then creating an Azure Work Item (Bug, story etc) using the values provided in the JSON payload.

When I attempt to use Dynamic Values in the Create work item action I am not getting any values from using the Dynamic Values in the action.

I have tried using the Json Parser, as well as Initialize Variables action both of which gave me no luck.

Logic App Issue

How can I get the dynamic values to produce an actual value ? I have confirmed that the JSON payload is being received by the Trigger, and is being sent correctly. I have also tried using custom headers in the payload (as shown below) but have had no luck.

Any advice would be greatly appreciated.

2

2 Answers

0
votes

If you want to use dynamic content to get value, you have to make sure the Content-Type is application/json. You could check the outputs in run history. If the Content-Type is not correct, the dynamic content will get wrong.

And if the Content-Type is other type, you still could find it will process the data, however you need parse it to json then select the value. Cause you don't provide your flow, so I provide my flow, maybe you could refer to it.

Use the triggerBody as the ParseJSON content, click Use sample payload to generate schema and paste you sample json data. Then use the expression to get the value like body('Parse_JSON')['field'] or use the dynamic content.

enter image description here

Hope this could help you, if you still have other problem please feel free to let me know.

0
votes

I ran into this same problem and eventually figured it out. For some reason in this case when starting with the when HTTP request received trigger, if you try to use those values in a subsequent step it seems to populate empty values from the schema and not the populated values in its output.

I was able to get it to populate the actual received values by updating the dynamic formula to specify triggerOutput rather than triggerBody, or if you need to parse json you can use outputs('Parse_Json') rather than body('Parse_Json'). Other than changing body to outputs in the formula, the rest of the dynamically populated formula is still the same.