How to Iterate Over a List in Jira Automation and Create New Issues for Each Value?

Nagarjuna Paladugu November 12, 2024

 

 

I am working on a Jira Automation rule and need some help with iterating over a list and creating new issues. Here’s what I’ve done so far:

  1. Trigger: The rule is triggered manually.
  2. Split Description: I use the description of the issue and split it based on a delimiter (e.g., --------). The split values are stored in a variable.
  3. Variable: The variable now contains a list of strings (each string is a test case).

Objective: I want to iterate over this list and create a new issue for each value in the list. Each new issue should have the same summary as the original issue, and the description should be the value from the list.

Steps I’ve Taken:

  1. Trigger: Manual trigger.
  2. Edit Issue: Split the description and store it in a variable 

Problem: I’m not sure how to iterate over the list and create new issues for each value in the list using Jira Automation. I need to:

  • Iterate over the list stored in the variable.
  • Create a new issue for each value in the list.
  • Set the summary of the new issue to be the same as the original issue.
  • Set the description of the new issue to be the value from the list.

Example: Original issue description:

Test Case 1: Valid Inputs
1. Open the login page of Amazon.com
2. Enter a valid username/email address.
3. Enter the corresponding valid password.
4. Click on the login button.
Expected Result: User should be successfully logged in and redirected to the homepage.

--------

Test Case 2: Invalid Password
1. Open the login page of Amazon.com
2. Enter a valid username/email address.
3. Enter an invalid password.
4. Click on the login button.
Expected Result: An error message should be displayed indicating that the password is incorrect.

After splitting, the variable contains:

[
  "Test Case 1: Valid Inputs\n1. Open the login page of Amazon.com\n2. Enter a valid username/email address.\n3. Enter the corresponding valid password.\n4. Click on the login button.\nExpected Result: User should be successfully logged in and redirected to the homepage.",
  "Test Case 2: Invalid Password\n1. Open the login page of Amazon.com\n2. Enter a valid username/email address.\n3. Enter an invalid password.\n4. Click on the login button.\nExpected Result: An error message should be displayed indicating that the password is incorrect."
]

Desired Outcome: For each value in the list, create a new issue with:

  • Summary: Same as the original issue.
  • Description: The value from the list.

 

1 answer

1 accepted

2 votes
Answer accepted
Gaurav Arora
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2024

Hi @Nagarjuna Paladugu ,

You can use "For each" > "Advanced branching" like below.

Screenshot 2024-11-12 142918.png

Screenshot 2024-11-12 142942.png

If you find this suggestion helpful, please accept the answer so that others can benefit as well!

Best regards,

Gaurav

Nagarjuna Paladugu November 12, 2024

Hi @Gaurav Arora ,

 

This is working, can u also explain me how to replace the \n to a new line

Given: "Test Case 1: Valid Inputs\n1. Open the login page of Amazon.com\n2. Enter a valid username/email address.\n3. Enter the corresponding valid password.\n4. Click on the login button.\nExpected Result: User should be successfully logged in and redirected to the homepage."

Expected:"Test Case 1: Valid Inputs

1. Open the login page of Amazon.com

2. Enter a valid username/email address.

3. Enter the corresponding valid password.

4. Click on the login button.

Expected Result: User should be successfully logged in and redirected

to the homepage."

 

Best Regards,

Nagarjuna

Suggest an answer

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

Atlassian Community Events