Loop iterates and enables to perform a specific operation on all the objects of an array. A Loop should be added as a child to the query step so that all the iterations brought as the response of the query can be traversed by the loop.
We will be creating a flow: "For each issue in GitHub, create an issue in Jira"
- Add a GitHub query "Get All Issues."
- Click on the three-dots menu on the far right of the query step and then "Add Child Step."
- Search and select "Loop."
- Enter 'Variable Name' where you want to store the objects of the array.
- Enter the 'Array' over which the Loop will iterate.
- You can directly provide your array here or use dynamic tags from any step that has your required data in an array.
- You can directly provide your array here or use dynamic tags from any step that has your required data in an array.
- Click Test.
- You will see a success message if the loop successfully traverses over every object coming in.
- Expand Iteration 1 to view the results.
- Click Next Iteration if you want to view the results of the next iteration.
- Similarly, you can keep on fetching the next iteration of the query and testing your Loop for every iteration until all the pages are exhausted.
- Click Test Again if you want to run the loop again.
- Click Done to collapse this step.
- Click Done to collapse this step.
- Click on the three-dots menu on the far right of the Loop step and then "Add Child Step."
- Search and select Jira.
- Add "Create Issue" action in Jira.
- Click 'Add My Account.'
- Sign up for free here if you don't have an account.
- Sign up for free here if you don't have an account.
- Enter the 'Project' name in which you want the issue to be created.
- Enter the 'Issue Type'.
- Enter the 'Parent Issue' if you selected sub-task in the 'Issue Type.'
- Select 'Assignee.'
- Enter the issue 'Summary.'
- Enter a 'Description.'
- For each array object in the query, a "Create Issue" action is performed in Jira.
- All the issues from GitHub fetched by query will be reflected one by one in Jira.
- You can add as many steps as you need inside the Loop step, including additional queries or conditional logic. The flow will end, once the Loop has completed iterating through all records.
Comments
0 comments
Please sign in to leave a comment.