Hi,
I started developing scripts in JIRA server 6.2.4, using the groovy scriptrunner plugin.
I want to populate a custom field (multi-line text - id: customfield_11170) with data from other custom fields on the "create issue"-screen, so that the populated field shows up on the "view issue"-screen.
When adding this scripted field to a any screen (doesn't matter on which screen) it executes , why?
It should only execute on the one screen I configured.
So I got the problem using one scripted field on create issue secreen and one on a transition screen, because the both execute on any transition!!!
I possible did not understand the hierarchie od JIRA, so please help me understand.
Thank you,
Alexander
I think that all of the scripted custom fields execute whenever JIRA is checking the value of the field. And JIRA does that A LOT. Basicaly each time you view issue, either directly or indirectly (displayed as link or on the dashboard gadget or as a rest API response), JIRA has to look up all the issue fields in context. You can see every execution of the field by adding a logging command to your script.
However there are plugins that can do exactly what you are trying to achieve - fire up a script on the create issue screen. I think "Behaviours" (currently being integrated with Script Runner) plugin can do that, as well as awesome JJupin plugin with it's "Live Fields" module.
EDIT:
Oh, and being aware that the scripts execute each time when you view issue, be REALLY careful to make your scripts in custom fields lightweight! In our company JIRA we've gone through the hype of "OMZG, SCRIPTED FIELDS EVERYWHERE *_*" and we have almost killed our instance by overusing scripted fields and making them far too complex. Scripted fields are awesome, and very powerful when used right, but remember that "with great power comes great responsibility"
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.