Hi,
I have two customfields of same type and same options, but one of them is hidden in all screens.
Now if a non-hidden customfield's option is selected, the hidden field should also be set with its respective option.
Thanks,
Bharadwaj Jannu
I got the solution by creating a new customfieldtype which extends MultiSelectCFType(required for our customfield).
In that I overrode getVelocityParameters method with the required things.
If you want the field to change without a workflow transition or client side JS, using Event listeners is the only remaining option I can think of.
https://confluence.atlassian.com/display/JIRA/Listeners
You can configure it to listen for the Issue Updated event and take whatever action you wanrt.
You may not be able to change the value of a hidden field, but if it is possible the JIRA Behaviors Plugin is the way to do it.
https://marketplace.atlassian.com/plugins/com.onresolve.jira.plugin.Behaviours
if the field are select list then you can try with following code
<script type="text/javascript"> jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { setFieldValue(); }); setFieldValue(); function setFieldValue(){ setValue(); //showing field $('#customfield_13816').change(function() { setValue(); }); } function setValue(){ var parentFieldValue=$("#customfield_13816 option:selected").text(); //hidden field $("#customfield_13817 option").each(function() { if($(this).text() == parentFieldValue) { $(this).attr('selected', 'selected'); } }); } }); </script>
add above script on second field description in field configuration
Hi rambanam,
Thanks for the answer, but using script make the browser compatible problems.
Is there any kind of functionality(like postfunction) which run exactly after a customfield is updated?
or by means of any plugin(like implementing cascade customfields) can we achieve this?
You can write a post function to copy field A(available on scree) to field B(hidden).
Use the Copy Value From Other Field Post function which is part of JIRA Suites
Hi Chaitra, thanks for the reply
But using workflow postfunction, the functionality will not work for edit operation?
another option is by hiding custom field using JavaScript and then you can fill the field valu by using postfunction
Dont have the Edit Operation. (this can be controlled by permission)
In Your Workflow have Edit tranistion at all the status & at this tranistion use the post function & this should work.
I didn't get you exactly.
My thinking is that though we write or use a workflow postfunction, it is going to work on creating or transitioning a issue only and it is not going to work on editing an issue. If not, please correct me.
It looks like you're new here. Sign in or register to get started.