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 :
@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.
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 event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event