Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Edit issue custom field with smart value from webResponse.body

Grzegorz Ostrowski February 9, 2022

In my automation rule I use send web request component. It returns me for example this json in {{webResponse.body}}:

{"zadanieNumer":"ZGL/2022/02/11","zadanieGuid":"dcc40184-e41c-4d70-97a9-053f6039b4cc"}

In next step i use Edit issue component to set value to custom field.

When I set field with value: {{webResponse.body.zadanieGuid}} i get empty value.

The same with {{webResponse.body.zadanieNumer}}. It should be possible to get value this way. Can somebody write mi what I am doing wrong?

I added screen with my Edit Issue component.

ScreenHunter 36 (01).png

 

1 answer

0 votes
Mark Davidson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 9, 2022

Hi @Grzegorz Ostrowski ,

I went ahead and tested your smart value and it's valid so there's no issues there. 

Could you confirm that you have the setting in the image below set?

Json Tester --> https://jsonpath.com/
Web Request.jpgTest.jpg

Grzegorz Ostrowski February 10, 2022

@Mark Davidson Yes I have it checked

ScreenHunter 37.png

I have if/else compound after web request compound to handle response. I get correct response. And correct json in {{webResponse.body}}.

Mark Davidson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2022

If possible could you please share a screenshot of your entire automation rule, hard to tell that one of the many factors that could be effecting this aren't present.

Grzegorz Ostrowski February 10, 2022

@Mark Davidson This is schemat of my automation rule:

ScreenHunter 38.png

Grzegorz Ostrowski February 10, 2022

@Mark Davidson  I have managed using this code in Edit Issue component to get values from JSON {"zadanieNumer":"ZGL/2022/02/11","zadanieGuid":"dcc40184-e41c-4d70-97a9-053f6039b4cc"}.

ScreenHunter 39.png

But it should be as simple as {{webResponse.body.zadanieGuid}}. Why it dont work in my case. Is this some kind of bug?

Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 13, 2022

Hi @Grzegorz Ostrowski 

From your solution you've posted above, it seems like the webhook body is being read in as a string, and not the dictionary/map structure. Is it possible to check whether the webhook sender is encapsulating the data inside a string when it sends the webhook?

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events