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,367,886
Community Members
 
Community Events
168
Community Groups

Automation loop through WebResponse results

Hi,
I am accessing the Tempo Plan Times in an automation via Web Response. Now I would like to know how to make a loop through the individual planed packages via the Jira automations. To get the ids of a specific description to delete the entire. Comparable to the loop you can create for LookupIssues.

Logic: 

  • Loop through entries
  • Condition:  If {{webResponse.body.results.get(entries).description}} contains "Firma AB
  • Then:  Delete Plan via Web Response 

 

Web Response Result with 2 entries 
"metadata": {

"count": 2

},

"results": [

{

"id": 30,

"startDate": "2022-09-20",

"endDate": "2022-09-20",

"description": "TEST-117 - Firma XY",

"plannedSecondsPerDay": 1020,

"includeNonWorkingDays": false,

"rule": "NEVER",

"recurrenceEndDate": "2022-09-20",

"totalPlannedSecondsInScope": 1020 },

{

"id": 31,

"startDate": "2022-09-20",

"endDate": "2022-09-20",

"description": "TEST-117 - Firma AB",

"plannedSecondsPerDay": 60,

"includeNonWorkingDays": false,

"rule": "NEVER",

"recurrenceEndDate": "2022-09-20",

"totalPlannedSecondsInScope": 60

}

Is this somehow possible? Any Ideas? 
Greetings
Nicole 

1 answer

1 accepted

2 votes
Answer accepted
Mark Segall Community Leader Sep 21, 2022

Hi @Nicole Ahlborn 

I'm still a bit of a novice myself with the Send Web Request, but you would need to perform an advanced branch against {{webResponse.body}}. You'll give your branch a variable like {{varIterate}} Then for each action you want to take you would simply go with {{varIterate.YOURDESIREDATTRIBUTE}} and it will process through the results.

NOTE - There will be a limitation of 50 results it can process in a single branch.

Hi @Mark Segall 
Thank you very much! Now it has finally worked.
I had to go one level further than body ({{webResponse.body.results}}), but it works!

Like Mark Segall likes this

Suggest an answer

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

Atlassian Community Events