Specifically, I want to automatically create Issue A when another issue (Issue B) transitions to Status C on Jira DC. During the creation of Issue A, the automation should copy data from Issue B into Issue A.
I’m currently using ScriptRunner to handle the logic. However, the automation creates Issue A first and only then populates the fields. Some of those fields are required, so Jira blocks the issue creation before the values can be copied over.
Is there a way to populate required fields at creation time (or otherwise work around this limitation) so that the issue can be created successfully?
Hello @Phương Hoàng Thị Mai ,
You could use a Jira automation to achieve this.
The key point is that, in the clone work item action, you must select all fields that are required for issue creation and ensure they are copied from the original issue.
Here is an example:
Would Jira automation work for you?
Unfortunately, I’m currently using Jira Data Center, so I’m not sure whether your instructions apply. Is there any workaround or alternative approach for Jira DC?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Phương Hoàng Thị Mai ,
I believe it is also possible to use this action in automations for Jira Data Center. Here is a link to an offical Atlassian document about cloning issues in Data Center.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must use IssueInputParameters to collect all the data (including required fields) in one place before calling the create command.
Do not create the issue first and then try to set the values, as this will fail Jira's validation checks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the relation between issue A and issue B? (Parent/Child)
Little bit elaboration will help.
Best,
Fadoua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, this is a common limitation you’re running into, and it’s not really a ScriptRunner bug — it’s how Jira’s issue creation works.
In Jira, required fields are validated at the moment of issue creation, before any post-functions or follow-up scripts run. So if ScriptRunner creates Issue A first and then copies values afterward, Jira will block it if required fields are empty at creation time.
The workaround is to populate required fields during creation, not after. With ScriptRunner, you should create the issue using IssueService (or the ScriptRunner issue creation API) and explicitly pass all required field values in the input parameters. That way, Jira validates the issue with those fields already filled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.