Have scripted field in linked issue(suppose issue B) , whose value I need to copy to custom field of issue(suppose issue A).
Can we do this using listener , please provide the sample code.
There's a long boring story about how scripted fields work, but it ends in "do not use scripted field results to calculate other stuff on issues - you might not get the right answer".
Imagine you have a scripted field that is "number of days elapsed between the issue got assigned to someone, and the current due date on it". And imagine that currently says "7".
Next, you have another calculation that simply says "days elapsed * 2".
If someone amends the due date, making it 3 days later, you may find the second field says 18 sometimes and 14 at others.
To fix this, your second calculation needs to repeat what the first one is doing, rather than take the result from the scripted field.