I'm trying to iterate over the elements of a web request to the rest api v3.
The result I get from the request contains all the information I need. In fact I can even print the result to audit log. With {{webResponse.body}} it results in:
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10321, id=10321, name=9.4.2, archived=false, released=false, startDate=2024-01-24, releaseDate=2024-04-26, overdue=false, userStartDate=24/Jan/24, userReleaseDate=26/Apr/24, projectId=10096},
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10325, id=10325, name=8.6.1, archived=false, released=false, startDate=2024-04-01, releaseDate=2024-08-16, overdue=false, userStartDate=01/Apr/24, userReleaseDate=16/Aug/24, projectId=10096},
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10326, id=10326, name=9.4.3, archived=false, released=false, startDate=2024-08-16, releaseDate=2024-12-31, overdue=false, userStartDate=16/Aug/24, userReleaseDate=31/Dec/24, projectId=10096},
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10327, id=10327, name=9.4.1.1, archived=false, released=true, startDate=2024-01-01, releaseDate=2024-03-20, userStartDate=01/Jan/24, userReleaseDate=20/Mar/24, projectId=10096},
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10328, id=10328, name=8.6.0.4, archived=false, released=true, startDate=2024-01-01, releaseDate=2024-02-17, userStartDate=01/Jan/24, userReleaseDate=17/Feb/24, projectId=10096},
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10332, id=10332, name=8.6.0.5, archived=false, released=true, startDate=2024-02-25, releaseDate=2024-03-01, userStartDate=25/Feb/24, userReleaseDate=01/Mar/24, projectId=10096},
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10333, id=10333, name=9.5.0, archived=false, released=false, startDate=2024-12-30, releaseDate=2025-12-31, overdue=false, userStartDate=30/Dec/24, userReleaseDate=31/Dec/25, projectId=10096},
{self=htps://xxxxxx.atlassian.net/rest/api/3/version/10335, id=10335, description=Auftrag von Curdin wegen AP7532, name=9.4.1.2, archived=false, released=true, startDate=2024-03-28, releaseDate=2024-04-10, userStartDate=28/Mar/24, userReleaseDate=10/Apr/24, projectId=10096}
It's a request to get https://xxxxx.atlassian.net/rest/api/3/project/PRJ/versions. But I don't know how to correct iterate over the result.
As the iteration did not work, after several different attempts I tried to access a single (aka first item) with something mentioned in other community questions:
What I'm surprised is, that there is no element/list/dict containing all this elements. I suppose the smart value {{webResponse.body}} is supposed to be this.
For completeness, here the "Send web request" which also shows state 200 up on validation:
I would be thankful for more hints about what to try or pointing out errors/problems in my attempts.
What is also strange/funny: the fields are ordered differently for my than on all the screenshots and videos I found online.
After several more attempts I found out that the result is not (correctly) stored in my new created variable.
I found a similar issue where there is the hint to print the number of elements of the response.
This correctly prints 9 in case of {{webResponse.body.size|0}} but prints 0 in case of {{response.size|0}}
Thus trying to iterate directly over {{webResponse.body}} instead the new variable works.
But this makes me wonder:
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.