Hi
I wrote a script field previously, and now I want call this field in another script, but this field return null.
for example:
I wrote a field script that returm sum of a number fields in subtasks of a Issue(called Overall_Weight), and it returned correct answer and shown this answer in view screen.
Now ,I Called this field with by this method (issue.getCustomFieldValue(Overall_Weight) , but retuen null.
I asked this question from Scriptrunner support , and tell me this problem fixed in jira 8.16 or above, my jira version is 8.5.0.
Did you use a solution in this version?
How to call script field in a another script?
Thanks
The short answer is that you don't.
Because of the way Jira works, you can not rely on the value of a scripted field being correct or even populated when you are running other scripts.
Your new script will need to replicate the code behind the scripted field.
Thanks @Nic Brough -Adaptavist-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marzi Goodarzian ,
for my knowledge you can't reuse code in another context. The only way is to use the same code of your scripted field in your script.
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Fabio Racobaldo _Herzum_
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.
Learn moreOnline 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.