Show / Hide fields based on other Field drop down values on Customer Portal
Asked by xiongpanfeng:

How to embed js in the JSM create request page.

After implementing the input summary field,

Description fields can be hidden.


Answers:
author: Sebastian Krzewi?ski
body: Hi [@xiongpanfeng](/t5/user/viewprofilepage/user-id/4844671)

By default JSM don't have option like you described. To do that you need additional app like Script runner and built-in behaviours features.

Regards,

Seba

comments: author: xiongpanfeng
body: Hi [@Sebastian Krzewi?ski](/t5/user/viewprofilepage/user-id/1561725)   

Thank you for your recommendation.

I want to write my own simple plug-in to deal with this problem, Can you help guide me?

thanks,

xiongpanfeng


author: Sebastian Krzewi?ski
body: I don't have that much experience with that.

Here you can find details about developing apps - <https://developer.atlassian.com/platform/marketplace/developing-apps-for-atlassian-data-center-products/>

Regards,

Seba


author: Anna Hryhoruk _Appfire_
body: Hello [@xiongpanfeng](/t5/user/viewprofilepage/user-id/4844671) ,

I would be glad to share a simple example of how this can be done using [Power Scripts](https://marketplace.atlassian.com/apps/43318/power-scripts-jira-workflow-automation?hosting=cloud&tab=overview)

You need 2 sil scripts (main and hook) + add Live Field configuration.   

lf_main_jsd.sil

```
lfInstantHook({"summary"}, "lf_hook_jsd.sil");
lfWatch("summary", {"summary"}, "lf_hook_jsd.sil");
```

lf_hook_jsd.sil

```
if (argv["summary"] != ""){
   lfHide("description");
  

} else {
   lfShow("description");
   
}
```

Also, you can add to the hook script an extra condition to check on which screen you are going to apply it , but you can also limit where the script will be used in Live Fields Configuration: ![2024-03-22 13 57 53.png](https://community.atlassian.com/t5/image/serverpage/image-id/313818i1816EE2A2A1E2E0E/image-size/large?v=v2&px=999 "2024-03-22 13 57 53.png")

So, here is the result:

![LF.gif](https://community.atlassian.com/t5/image/serverpage/image-id/313825iFF77D093EE1FFA89/image-size/large?v=v2&px=999 "LF.gif")

As you can see, it is quite simple. But since I don\`t know if you have sil scripting experience, I will add here some helpful documentation links: [Live Fields](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15488008/Live+Fields), [Live Fields Routines](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480684/Live+Fields+Routines), and some examples [Switching and Toggling](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15483010/Switching+and+Toggling), [Validating Custom Fields](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15482986/Validating+Custom+Fields)

Hope it helps!  
Anna

comments: author: xiongpanfeng
body: Hi [@Anna Hryhoruk _Appfire_](/t5/user/viewprofilepage/user-id/5048094)   

Thank you for your recommendation.

I want to write my own simple plug-in to deal with this problem, Can you help guide me?

thanks,

xiongpanfeng


author: Anna Hryhoruk _Appfire_
body: Actually, SIL scripting language (the one that Power Scripts uses as a key engine) allows users to create their own plugins. Please check this documentation page for more details: [Development using SIL](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15486407/Development+using+SIL) , [Tutorial](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15485473/Tutorial+new)

Best regards,  
Anna


author: Ste Wright
body: Hi [@xiongpanfeng](/t5/user/viewprofilepage/user-id/4844671)

This isn't natively available - but Apps will enable you to do this - either...

* [Scripting Apps](https://marketplace.atlassian.com/search?hosting=dataCenter&product=jira-service-management&query=script), like [Scriptrunner](https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?hosting=datacenter&tab=overview), or [Power Scripts](https://marketplace.atlassian.com/apps/43318/power-scripts-jira-workflow-automation?hosting=datacenter&tab=overview), or...
* [Form Apps](https://marketplace.atlassian.com/search?hosting=dataCenter&product=jira-service-management&query=forms), like [ProForma](https://marketplace.atlassian.com/apps/1215833/proforma-forms-checklist-for-jira?hosting=datacenter&tab=overview), [ProForma (Lite)](https://marketplace.atlassian.com/apps/1219499/proforma-lite-forms-checklists?hosting=datacenter&tab=overview), or [Extension for Jira Service Management](https://marketplace.atlassian.com/apps/1212161/extension-for-jira-service-management?hosting=datacenter&tab=overview)

Ste

comments: author: xiongpanfeng
body: Hi [Stephen Wright _Elabor8_](https://community.atlassian.com/t5/user/viewprofilepage/user-id/1166470)

Thank you for your recommendation.

I want to write my own simple plug-in to deal with this problem, Can you help guide me?

thanks  


Tags: jira-service-desk-data-center

jira-service-management

jira-service-management-data-center

jira-service-management-server