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.
Use the Copy Value From Other Field Post function which is part of JIRA Suites
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chaitra, thanks for the reply
But using workflow postfunction, the functionality will not work for edit operation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are correct - you can't do post-functions on Edit.
This is why Chaithra said "don't have the edit operation". You remove the edit permission from the project, and create transitions in the workflow called "edit" which go back to the current status.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can only have post function at Workflow transtion & not on the updates of customfield.
Other options are,
But I personnally feel Workflow is much easier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Nic,
I got little idea on this. But rather moving to workflow changes, is there any kind of post functionality executed immediately after the customfield is checked/selected and before the update button is pressed on edit screen?
If at all exists, please help in that concern.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I feel like we're repeating ourselves here. We both keep telling you there are no post-functions on Edit. Then you ask the same question again.
Please re-read Chaithra's detailed answers again, mine are just "there are no post-functions on Edit", and Chaithra gives you the options I'd suggest already
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic @Chaitra
I try to use listener approach.
For issue creation: ISSUE_CREATED
For issue updation: ISSUE_UPDATED event types exist.
Now the ISSUE_UPDATED event is generated for updations using issue panels also.But is there any event specific to issues updating from edit screen itself?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Issue updated is the event fired from edit. When you say "generated for updates using issue panels", what's actually happening is the system is using "Edit", but not going through the screen. It's the same process, but with only one field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can write a post function to copy field A(available on scree) to field B(hidden).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
another option is by hiding custom field using JavaScript and then you can fill the field valu by using postfunction
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.