You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hi Everyone,
I have two behavior script which works fine. Now I want to access the value stored in one script to another. I tried accessing the value in behavior script initializer but I am getting null value.
Behavior script :
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
@BaseScript FieldBehaviours fieldBehaviours
def A = getFieldById("customfield_16355")
Object A_val = A.getFormValue() as int
def A_Hours = getFieldById("customfield_16365")
Object A_Hour = 125*A_val
A_Hours .setFormValue(A_Hour )
Now when I tried to get value of field which is set by using A_Hours .setFormValue(A_Hour ) in the other behavior script OR in the initializer console of behavior script but I am getting null value.
Could you please help me on this.
Thanks,
Suchit
Ok, I'll take a stab at this... I see no one is daring to answer.
The short answer is no, there is no cross-talk possible between server-side behaviour script.
The longer answer requires some explanation of what behaviour does.
When you open a screen (create, edit, transition), there is a bunch of back and forth between browser-side scripts and the jira server backup using special rest endpoints supplied by scriptrunner.
Then each time you modified a field included in the response listed in #3, that validator is re-un using new and updated data.
You see, each of those server-side requests are executed in a standalone transaction. So one is not aware of what is happening to the other.
Now, if you have some fields that are interdependent, you may need to combine your 2 scripts and run them from each of your fields.
Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.