Bypass required field validation when child issue is created by cloning parent issue?
Asked by Digvijay Singh Gehlot:

Hi Community,

I have a Parent Project P and a Child Project C.

In Project P, I have configured a Jira automation which clones the Parent issue to Child issue in Project C when a new Parent issue is created in Project P.

Challenge:

* In Project C, there is a custom field on Create Issue screen which is set as Required and is not allowing the above automation to clone the issue from Project P.
* Audit log is saying "Issue condition passed; Clone issue: Error creating issue \> Custom Field is required."

So, how can I bypass mandatory field validation when a new child issue is created in Project C by cloning the parent issue in Project P?

Please guide on how I can configure this by either scriptrunner, jira automation, jmwe app or any other configurations, it would be a great help.

Thanks


Answers:
author: David Fischer
body: Hi [@Digvijay Singh Gehlot](/t5/user/viewprofilepage/user-id/5431110)

To make your field required during issue creation, you are currently using a Validator on the Crate transition. If that validator is a JMWE Field Required Validator, you can add a Conditional Validation script like this:

```
issue.key == null
```

This will skip validation during a Clone operation.


author: Trudy Claspill
body: Hello [@Digvijay Singh Gehlot](/t5/user/viewprofilepage/user-id/5431110)

If the field is required for issues in Project C, then why would you want to bypass that? I'm sure there is a reason that the field is required, so you should be filling it in during the Automation Rule Clone Issue action.

comments: author: Digvijay Singh Gehlot
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Thank you for your message.

I would like to provide more detail above my use-case below:

The custom field is a User Picker field and is present on Create Issue screen which is made Required by configuring a Validation on the Project C Workflow.

The usage of making this Required and keeping it as Empty at the time of creating the issue in Project C is that when Reporter creates the issue, he has to select a user in this custom field which then set the Assignee on the issue when it is created.

I want to pass a Condition either using scriptrunner, jmwe app, post function or jira automation, where when a new Parent issue is created in Project P then jira automation will clone the Parent issue and create a Child issue in Project C by passing the existing required field validation in Project C workflow.

Thanks


author: Trudy Claspill
body: Hello [@Digvijay Singh Gehlot](/t5/user/viewprofilepage/user-id/5431110)

Is the goal to create the issue in project C and leave the field blank, all via automation, or to have the automation create the issue and also set the field?

Can you please show us the Automation Rule you have constructed so far? I'm not sure that I have fully understood your intention, and seeing what you have might help clarify that.

[@David Fischer](/t5/user/viewprofilepage/user-id/538255) made a good point also that the validator in the workflow may be customizable if you have a third party app that extends workflow capabilities.


Tags: appfire

auto

clone

data-center

field-configuration

jira-automation

jira-data-center

jira-software

jmwe-app

parent-child

required-field

scriptrunner