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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,208
Community Members
 
Community Events
184
Community Groups

How Can I access list of items in JSON using Jira Automation ?

Hi All,

 

I am new to Jira Automation and I am trying to capture the result of webrequest using Jira automation. But when I try to get the items of the list contained in JSON, I get no response. Could you please help me with it?

The payload is similar to:

{
"maxResults": 100,
"startAt": 0,
"total": 3,
"isLast": false,
"values": [
{
"id": "130",
"value": "ABC",
"disabled": false
},
{
"id": "140",
"value": "XYZ",
"disabled": false
},
{
"id": "130",
"value": "AABB",
"disabled": false
}]

 

and the print smart value that I am using it {{webResponse.body.values(0)}} to access the first element so that my expected outcome is {"id": "130","value": "ABC","disabled": false}

2 answers

0 votes
Danish M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 06, 2023

It should be something like: 

webResponse.body.values.get(2)

Something similar is stated here :

https://community.atlassian.com/t5/Automation-questions/Accessing-a-JsonArray-syntax/qaq-p/1938007#:~:text=webResponse.body.results.version.number.get(2)

Also as @Bill Sheboy stated, it would be better if we know the complete web request return to understand the exact smart value to be entered. 

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 05, 2023

Hi @Yogesh Ranjitkar 

You note that the "payload is similar to..." but does it exactly match what you are expecting?

One way to check this is to write the entire response to the audit log after the webrequest to learn what is happening.

And...have you selected the option to wait for the webrequest return before continuing with the rule steps?

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events