Create Multiple Jira Issues Based on a Custom Number Field Using Automation

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

This guide will walk you through the process of using Jira Automation to create multiple issues based on a value specified in a custom number field.

Environment

Jira Cloud

Solution

Step-by-Step Guide

  • Select the trigger for your automation rule. For this example, we will use the Issue Created trigger.

  • Add Action: Create variable:- To initialize the looping values

    • Variable name: varLoopValues

    • Smart value: NULL

      (Auto-migrated image: description temporarily unavailable)
  • Add Action: Create variable:- Replacing the old value with your looping values.

    • Variable name: varLoopValues

    • Smart value: {{varLoopValues.rightPad(varLoopValues.length.plus(issue.description), "X").remove("NULL").replaceAll("X","X,").substringBeforeLast(",")}}

    • (Auto-migrated image: description temporarily unavailable)
      • In this example, we are using issue description to store number values. Replace '<Your number custom field>' with your field name.

        Smart value

        1 {{varLoopValues.rightPad(varLoopValues.length.plus(<Your number custom field>), "X").remove("NULL").replaceAll("X","X,").substringBeforeLast(",")}}
  • Add Action: Advanced branch:

    • Smart value: {{varLoopValues.split(",")}}

    • Variable name: varLoopVariable

      (Auto-migrated image: description temporarily unavailable)
    • Add Action: Create issue:- To create multiple issues based on the value.

ℹ️ Directly import the automation JSON file in your project using the step mentioned here.

Copy the below into a file and save as JSON file

Create Multiple Jira Issues Based on a Custom Number Field Json

1 {"cloud":true,"rules":[{"id":19931846,"clientKey":"eb42e4c8-9ed8-387e-91a0-9d734ba6c1c1","name":"Create Multiple Jira Issues Based on a Custom Number Field","state":"ENABLED","description":"","authorAccountId":"70121:646025f4-3216-4734-a4c3-eca3f5c3f050","actor":{"type":"ACCOUNT_ID","value":"557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"},"created":1718274007299,"updated":1718277909886,"trigger":{"id":"469460657","component":"TRIGGER","parentId":null,"conditionParentId":null,"schemaVersion":2,"type":"jira.manual.trigger.issue","value":{"inputFromUsers":false,"inputPrompts":[],"groupIds":false,"groups":[],"issueFilter":null,"jQLFilter":null},"children":[],"conditions":[],"connectionId":null},"components":[{"id":"469460658","component":"ACTION","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"jira.create.variable","value":{"id":"_customsmartvalue_id_1718274490850","name":{"type":"FREE","value":"varLoopValues"},"type":"SMART","query":{"type":"SMART","value":"NULL"},"lazy":false},"children":[],"conditions":[],"connectionId":null},{"id":"469460659","component":"ACTION","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"codebarrel.action.log","value":"1st {{varLoopValues}}","children":[],"conditions":[],"connectionId":null},{"id":"469460660","component":"ACTION","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"jira.create.variable","value":{"id":"_customsmartvalue_id_1718274575063","name":{"type":"FREE","value":"varLoopValues"},"type":"SMART","query":{"type":"SMART","value":"{{varLoopValues.rightPad(varLoopValues.length.plus(issue.description), \"X\").remove(\"NULL\").replaceAll(\"X\",\"X,\").substringBeforeLast(\",\")}}"},"lazy":false},"children":[],"conditions":[],"connectionId":null},{"id":"469460661","component":"ACTION","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"codebarrel.action.log","value":"2nd {{varLoopValues}}","children":[],"conditions":[],"connectionId":null},{"id":"469460662","component":"BRANCH","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"jira.smart.values.branch","value":{"id":"_customsmartvalue_id_1718274795198","name":{"type":"FREE","value":"varLoopValues"},"type":"SMART","query":{"type":"SMART","value":"{{varLoopValues.split(\",\")}}"},"lazy":false},"children":[{"id":"469460663","component":"ACTION","parentId":"469460662","conditionParentId":null,"schemaVersion":10,"type":"jira.issue.create","value":{"operations":[{"field":{"type":"ID","value":"summary"},"fieldType":"summary","type":"SET","value":"{{varLoopValues}}"},{"field":{"type":"ID","value":"description"},"fieldType":"description","type":"SET","value":null},{"field":{"type":"ID","value":"project"},"fieldType":"project","type":"SET","value":{"value":"current","type":"COPY"}},{"field":{"type":"ID","value":"issuetype"},"fieldType":"issuetype","type":"SET","value":{"type":"COPY","value":"current"}}],"advancedFields":null,"sendNotifications":false},"children":[],"conditions":[],"connectionId":null}],"conditions":[],"connectionId":null}],"canOtherRuleTrigger":false,"notifyOnError":"FIRSTERROR","projects":[],"labels":[],"tags":[{"id":65859699,"tagType":"IS_RULE_UPDATED","tagValue":"true"}],"ruleScope":{"resources":["ari:cloud:jira:16e89efc-ab25-43f8-84d7-0997692fc8c7:project/10075"]},"ruleHome":{"ruleLifecycleHome":{"locationARI":"ari:cloud:jira:16e89efc-ab25-43f8-84d7-0997692fc8c7:project/10075"},"ruleBillingHome":{"locationARI":"ari:cloud:jira-servicedesk::site/16e89efc-ab25-43f8-84d7-0997692fc8c7"}},"writeAccessType":"UNRESTRICTED","collaborators":[],"billingType":"NORMAL"}]}

Updated on April 14, 2025

Still need help?

The Atlassian Community is here for you.