Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bypass required field validation when child issue is created by cloning parent issue?

Digvijay Singh Gehlot
Contributor
August 1, 2024

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

2 answers

0 votes
David Fischer
Community Champion
August 2, 2024

Hi @Digvijay Singh Gehlot 

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. 

0 votes
Trudy Claspill
Community Champion
August 1, 2024

Hello @Digvijay Singh Gehlot 

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.

Digvijay Singh Gehlot
Contributor
August 2, 2024

Hi @Trudy Claspill 

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

Trudy Claspill
Community Champion
August 2, 2024

Hello @Digvijay Singh Gehlot 

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 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.

 

Suggest an answer

Log in or Sign up to answer