# Need script to make Text field mandatory while creation issue based on two custom field value

**URL:** <https://forum.library.adaptavist.com/t/need-script-to-make-text-field-mandatory-while-creation-issue-based-on-two-custom-field-value/534>\
**Category:** ScriptRunner\
**Tags:** behaviour, data-center, jira, listener, post-function\
**Created:** [November 5, 2024, 5:00pm UTC](https://forum.library.adaptavist.com/t/need-script-to-make-text-field-mandatory-while-creation-issue-based-on-two-custom-field-value/534 "2024-11-05T17:00:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shiva2430](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Shiva2430](https://forum.library.adaptavist.com/u/Shiva2430)\
**Post date:** [November 5, 2024, 5:00pm UTC](https://forum.library.adaptavist.com/t/need-script-to-make-text-field-mandatory-while-creation-issue-based-on-two-custom-field-value/534/1 "2024-11-05T17:00:43Z")

</div>

Hi Team,

We have three custom fields 1. Customer name (text field), 2. products (Single select) and reported by (single select).

When products = test and reported by = users the customer name field need to be mandatory while creation of issue.

Could you please help with script to achieve this requirement.

---

<div class="post-metadata">

**Author:** ![nikolayr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/nikolayr/32/254_2.png) [@nikolayr](https://forum.library.adaptavist.com/u/nikolayr)\
**Post date:** [November 18, 2024, 1:39pm UTC](https://forum.library.adaptavist.com/t/need-script-to-make-text-field-mandatory-while-creation-issue-based-on-two-custom-field-value/534/2 "2024-11-18T13:39:45Z")

</div>

Hi Shiva2430,  
you can use “Simple Scripted Validators” see documentation here [https://docs.adaptavist.com/sr4js/7.0.0/features/workflows/validators/simple-scripted-validators](https://docs.adaptavist.com/sr4js/7.0.0/features/workflows/validators/simple-scripted-validators)  
and put it on Create/Submit transition.
