Create several issues combining fields

Use case

This use case is useful for giving instructions on how create several issues from the combination of two fields with different options. Every newly created issue will contain a different combination of these two fields and there will be a issue for each possible combination.

🗒️ Prerequisites

Set up custom fields

  1. Create a Select List (single choice) custom field

    Name: Countries

    Options:

    • Germany

    • Spain

    • US

  2. Create another Select List (single choice) custom field

    Name: Approaches

    Options:

    • Approach A

    • Approach B

⚒️ Configuration

Add a Create issue post function to the workflow transition of your choice.

Issues to be created

Expression

Write an expression using this format with parsing mode in Number .

count(toStringList(%{issue.cfCountry})) * count(toStringList(%{issue.cfApproaches}))

Issue type

Choose Selected issue type.

Specific issue type

Choose Sub-task .

Parent issue

Choose Current issue.

Summary

Enter the following expression 

Bash
"Country: " + nthElement(toStringList(%{issue.cfCountry}),ceil(^ / count(toStringList(%{issue.cfApproaches})))) + " / Zusatzinfo: " + nthElement(toStringList(%{issue.cfApproaches}),(modulus(^,count(toStringList(%{issue.cfApproaches}))) = 0 ? count(toStringList(%{issue.cfApproaches})) : modulus(^,count(toStringList(%{issue.cfApproaches}))))

with parsing mode set to  Advanced text .

Country

Enter the following expression

Bash
nthElement(toStringList(%{issue.cfCountry}),ceil(^ / count(toStringList(%{issue.cfApproaches}))))

with  parsing mode set to  Advanced text .

Approaches

Enter the following expression

Bash
nthElement(toStringList(%{issue.cfApproaches}),(modulus(^,count(toStringList(%{issue.cfApproaches}))) = 0 ? count(toStringList(%{issue.cfApproaches})) : modulus(^,count(toStringList(%{issue.cfApproaches})))))

with  parsing mode set to  Advanced text .


📚 Related use cases