Scriptrunner script to make a JSM custom field required depending on the value of another field

Can I get a sample of Scriptrunner script to make a JSM Cloud custom field required depending on the value of another field?

3 answers

1 accepted

2 votes
Answer accepted
Rik de Valk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 14, 2024

Hi @Kiranmayi Yalamanchi _eCloud Labs Inc_ , 

If you're looking for a solution to work for Customers on the JSM portal, you can read this page

If you're talking about making it mandatory for Agents, you can probably use the ScriptRunner Behaviours for that. See this page for example scripts. 

If you want to make the field mandatory during a certain transition, you can use the suggestion provided by @Pavol Gočal . 

Have a nice day. Rik 

 

Thank you, @Rik de Valk . for providing the useful links. I used the Agent version and is working perfectly!


Like Rik de Valk likes this
2 votes
Pavol Gočal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2024

Hello @Kiranmayi Yalamanchi _eCloud Labs Inc_

try using "Validators" in transition options:

transition options.png

Click "Add validator" and select "Field Required Validator (JMWE app)" that allows you to specify conditions:

Field required Validator (JMWE app).png

In this validation, you can specify required field and "conditional validation" (if true, field is required, if false, field is not required):

conditional validation.png

 

@Pavol Gočal ,thanks so much for providing the simplest solution. However, we don't have that plugin and I am recommending it to our team immediately. 
Thanks again!

0 votes
kurt bowden
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 14, 2024

Thanks for sharing. I found a lot of interesting information here. ADP Vantage Hcm

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events