You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
I'm trying to use a smart value to extract the value
field in the fourth element of an array from a web response, but I haven't been successful. Can someone please help me identify what I'm missing?
So far, I have tried {{webResponse.body.custom_fields.get(3).value}}, {{#webResponse.body.custom_fields}}{{#if(equals(name,"resolution_note"))}}{{value}}{{/}}{{/}} and few other things but no luck.
Thanks Bill for the reply.
Yes, I am try to do this in Jira Automation.
I am making an external API call from Jira Automation and using the API response to set the value of one of Jira custom fields
I can capture the entire response in the log action using {{webResponse.body}} but having hard time parsing the Json.
Any idea how can I convert array into list in Jira Automation?
Hi @Dharmesh Patel -- Welcome to the Atlassian Community!
Context is important for a question like this...
Are you doing this in an automation for Jira rule? If so, please post an image of your complete rule, images of any relevant actions, and an image of the audit log details showing the rule execution.
Until we see those...
Have to tried writing the entire web response to the audit log to confirm it matches what you expect in your parsing attempts?
Next...Those square brackets tell me response's custom_fields attribute may contain an array, and not a list. And so that cannot be parsed with get() until it is converted to a list.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try sticking to one conversation thread; that will help others looking at this question to learn if there are multiple possible answers. Thanks!
Why are you using a REST API call to set a custom field? Are you updating issues in another Jira instance / site?
Again, would you please post an image of your entire rule? The audit log is helpful but it does not show all possible things which happen for a rule execution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can't paste the rule, have some sensitive info in it.
I need to call an external provider API to fetch some data and then use that data to set the custom field with in Jira. I basically need to map the fields between the two solutions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries on seeing the rule. You may want to review it with a colleague to confirm it works as you planned.
Did you note my comment about arrays versus lists? That response cannot be parsed as a list and so instead you may need to either:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.