Hi All,
Is it possible to add a conditional custom field in create issue page?
If yes, how? I have just started customising jira code, your help is appreciated.
My requirement is to display a custom field in create issue page based on specific condition of the previous drop down custom field value.
Regards
Andrew Paul S
i think you are trying to show or hide field on selection of select list if yes then use following script
<script type="text/javascript"> jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { callChangeFunction(); }); callChangeFunction(); function callChangeFunction(){ showHidField(); // dropdown custom field change function $("#customfield_10625").change(function() { showHidField(); }); } function showHidField(){ //drop down field selected value var dropDownFieldval =$.trim($("#customfield_10625 :selected").text()); //test field1 $("#customfield_10639").closest('div.field-group').hide(); if(dropDownFieldval == 'Project'){ $("#customfield_10639").closest('div.field-group').show(); }if(dropDownFieldval == 'Release'){ $("#customfield_10639").closest('div.field-group').show(); } } }); </script>
Hi @Rambanam Prasad
I have similar requirement, i have a radio button called Test1.
When Test1 value is yes, other custom fields ( test2, test3, test4) should show.
when Test1 values is No, other custom fields should be hidden from create screen and edit screen
Can this be done with above java script, or i should create a custom plugin and put it in .js file and .xml file?
Thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, with above script you can do that, change from change event click event at line 10 and change the way of selected value for radio button at line 18 i suggest to add it as webresource module in plugin, check the link provided in @Bharadwaj answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bharadwaj for your quick response. I wanted to make sure this is the file, so cut the file createissue-details.jsp and placed in another location. Restarted the service, but still create issue page is shown.
I think there is someother file corresponds to it or do you have any suggestion.
Regards
Andrew Paul S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you need to restart jira.
But changing the default files might lead to Jira corruption. So I prefer to use external things like creating plugin, adding javascript.
Tell your exact requirement which I am able to look into.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks for your reply. Can anyone help me. its urgent.
I need the source code file name corresponding to the create issue page.
Since this is the first time touching the code.. still searching to find the file name.
Your help is appreciated.
Regards
Andrew Paul S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{...}\Atlassian\JIRA\atlassian-jira\secure\views\createissue-details.jsp
in {...}\Atlassian\JIRA\atlassian-jira\WEB-INF\classes\actions.xml you search for CreateIssue
I donot have source code, you search for CreateIssue class file in your jira installation directory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you wish to write javascript then go through
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andrew,
You can probably use the features of the Workflow Toolbox plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.