It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Show/Hide Custom text field based on Another custom field selected value.

Michael Lasonde Oct 12, 2017

Hopefully someone might be able to lend a hand. I have what you guys might say is an easy one but damned if I can figure it out.

 

I have a custom dropdown field (id 12000) with 4 options Critical, High, Medium, Low.

I have a custom free text multi line field (id 12001) that I would like to only show on the create screen when Critial is selected.

I do not have much scripting experience I came across this script listed below and then didn't know where to go. I would like to be able to just paste this into the description of the 12001 field and keep on rolling. any help would be greatly appreciated. 

<script type="text/javascript">

  priority = document.getElementById('priority');

  if (priority) {

      target = document.getElementById('customfield_10000');

      // Hide the target field if priority isn't critical

      if (priority.value != 2) target.style.display='none';

 

      priority.onchange=function() {

          if (this.value == 2) {              

                     target.style.display = ''; 

                     target.value="enter message here";

                  } else {

                 target.style.display='none';

          }

      }

  }

</script>

1 answer

0 votes
Ethan Foulkes Oct 13, 2017

Hi Michael,

You can do this using the Power Scripts add-on.

There is a video tutorial walking you through in detail along with the code here.

Let me know if you have any questions.

Hope you can make it work!

Michael Lasonde Oct 13, 2017

Thanks Ethan, Im going to give this a shot I'll let you know how it goes. Thanks again

Anna Protopapa Oct 31, 2017

I went through the Power Script tutorial and I tried to hide some fields. But in Jira Service Desk Portal it doesn't work. Is there a way to play this feature on the JSD ustomer portal?

Thank you

Michael Lasonde Oct 31, 2017

For the customer portal I use a plugin Extension for Jira Service desk

its specifically designed to modify the Customer Portal.

For hide/show scripting within the tool itself (Create, edit, view) I use Script Runner.

Hope this helps

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira Service Desk

4 changes to queues and issues you don’t want to miss

Hello Atlassian Community! I'm Tania, a Senior Product Marketing Manager for Jira Service Desk Cloud! I'm excited to announce some exciting improvements coming up for those who work with queues and...

851 views 9 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you