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.
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.
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"
Atlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG