Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Send web request to each json data

Caio.Queiroz August 2, 2023 edited

Hi everybody! 

I need to iterate through a JSON and then use the username to make a web request to /rest/api/3/user/search?query=<username> to get all accountIDs

 

When I tried to do this, the parameter sends all the JSON usernames to one web request

Here is my automation:

Captura de tela 2023-08-02 165804.png

1 answer

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.
August 2, 2023

Hi @Caio.Queiroz 

Without seeing more information about your rule, or the audit log details showing the rule execution, I hypothesize the problem is in your advanced branch...and that you are not supplying a source / smart value expression that can be split into a list.

If you post the details of that branch, it may help the community to offer more suggestions.

Kind regards,
Bill

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.
August 3, 2023

Your advanced branch is referencing {{webResponse.body.shifts}} content.  Let's try some basic "walking the rule" diagnostics...

(1) Do you have another web request action before that branch which is populating the webResponse?  If not, the branch has no data to process.

(2) If yes for above, have you selected the option to "Delay execution of subsequent rule actions" for that web request action?  If not, it is possible the web request did not finish before the rule continued.

(3) If yes for above, have you checked the results of that call before proceeding with the rule?  If not, it is possible the web request failed and provided no data for the advanced branch.

(4) If yes for above, have you written the results of the web request action to the audit log to confirm they contain what you expect?  If not, you may not be selecting the correct information for the advanced branch.  The error messages you are seeing seem to indicate this is related to the problem.

(5) If yes for above, have you checked if the web response feeding the advanced branch contains characters which require escaping?  If not, please review the documentation for the in-line URL encoding when building your call: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#URL-encoding

And so on, for other possible causes of this symptom.

Like Kalyan Sattaluri likes this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, dance, gamification, badge, razzle dazzle, team '25 anaheim

Earn a one-day badge today and do the Atlazzle Dazzle! 🕺

Today only! Share what you’re the most excited about for Team ‘25 or just dance out the beginning of a new quarter with us.

Comment the post
AUG Leaders

Atlassian Community Events