Emmanuel Katto Uganda : What is the process for setting up linked issues according to user count?
Asked by Emmanuel Katto:

Hi Everyone, I'm **Emmanuel Katto** from Uganda, I'm looking for guidance on creating linked issues based on the number of users in a custom field. Specifically, I have a user picker custom field and need to generate linked issues for each user listed in that field, with each user's name included in the summary of the new linked issues. How can I achieve this using Jira automation?

Regards

**Emmanuel Katto Uganda**


Answers:
author: Sonal Verma
body: Hi Emmanuel Katto,

To create linked issues in Jira for each user listed in a user picker custom field and include each user's name in the summary of the new issues, you can use Jira Automation. Below is the step-by-step guide to setting up this automation rule:

### Step 1: Create a New Automation Rule {#toc-hId--2146715151}

1. Go to **Project Settings** (if you want the rule to apply to a specific project) or **System Settings** (for global rules).
2. Navigate to **Automation**.
3. Click on **Create Rule**.

### Step 2: Set Up the Trigger {#toc-hId-340797682}

1. Choose a trigger depending on when you want this automation to run. For example:
   * **Issue Created**: If you want to create linked issues whenever a new issue is created.
   * **Field Value Changed**: If you want to trigger the rule when the user picker field is updated.

### Step 3: Add a Branch to Iterate Over Each User {#toc-hId--1466656781}

1. Click on **New Action** and choose **Branch rule / related issues**.
2. Select **For each value in a field**.
3. Choose your **User Picker** custom field from the list.

### Step 4: Add the Action to Create Linked Issues {#toc-hId-1020856052}

1. Inside the branch, click on **New Action** and select **Create issue**.
2. Configure the new issue:
   * **Project**: Select the project where the new issues will be created.
   * **Issue Type**: Choose the type of the linked issue.
   * **Summary** : Use the smart value `${field}` to include the user's name in the summary. For example, `"Task for ${field.displayName}"`.
   * **Other fields**: Set any other necessary fields.

### Step 5: Link the Created Issues {#toc-hId--786598411}

1. After configuring the new issue creation, add another action **Link issue**.
2. Set **Type of link** (e.g., "Relates to", "Blocks", etc.) and choose **Most recently created issue** to link the new issue to the original one.

### Step 6: Publish the Rule {#toc-hId-1700914422}

1. Save and name your rule.
2. Test the rule with a sample issue to ensure it behaves as expected.

### Example Smart Values: {#toc-hId--106540041}

* **`${field.displayName}`**: To get the full name of the user.
* **`${field.emailAddress}`**: If you want to use the email address.

### Important Notes: {#toc-hId--1913994504}

* Make sure your user picker field allows multiple users.
* Depending on your Jira setup, you might need admin permissions to create global rules.

This rule will create a linked issue for each user in your custom field, with the user's name in the summary. The branch function iterates over each user, ensuring that each one gets their corresponding issue.

This approach should be flexible enough to handle various user picker fields and different linked issue types.


Tags: cloud

jira

jira-cloud