How to hide/show Message custom field (for edit) based on checkbox?

Hi,

I have added custom message field on the transition screen and I would like to make that message field popup and popoff based on the checkbox selection.

Ready.PNG

The checkbox name is 'Common Component Change Request' and value 'Not Requested' if user didnot check this box then only I want to show this message else not.

How to do that?

2 answers

Hi,

have you tried to use add-on Dynamic Forms? There are several custom fields that can show and hide other custom field depending on selected value. I think that dynamic check box is what you are looking for.

 

I hope I've helped you.

 

Best Regards

Hi Deniel,

I really appreciate you response.

Actually we are using that message field only one place. Does it seems expensive to buy add-on for less usage.

What would you say?

Thanks

0 vote

You can try to inject your own javascript, but you would be better off with an add-on that does it internally (as injection is difficult, ugly and often fails)

Script Runner has the Behaviours module which pretty much had show/hide other field as it's first reason to exist.  There are others, including Dynamic Forms as Daniel mentions which can enable it

Hi Nic,

I tried injecting my javascript in field configuration and even in custom field's edit default values but it didnt work.

My code will be like this:

//Common Component cf_14503

//Message field cf _4300

$('#customfield_14503-2').click(function () { 

 

if (document.getElementById('customfield_14503-2').checked) {
AJS.$("#customfield_14300").closest('div.field-group').hide();

}
else{
AJS.$("#customfield_14300").closest('div.field-group').show();

}}

I dont no much information on javascript and where would you suggest to apply this code to affect.

 

Thanks

Atlassian have been removing the abilty to inject dubious javascript like that.  The only place it works now is in the announcement banner.

Hi Nic,

I tried it in the announcement banner but didnt work for me either.

Thanks

 

Is the javascript injected ok, and just not appearing to run?  Use the debug tools in the browser to find it.

It works for other custom fields but not for message field.

Let me find it in the debug tools.

Thanks

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,240 views 14 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot