Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,033
Community Members
 
Community Events
184
Community Groups

Using Script field in another script

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

2 answers

2 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 29, 2023

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.

0 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 29, 2023

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

Suggest an answer

Log in or Sign up to answer