I have two issue types (project budget and order request) and they are linked using the "relates to" link type. Each project budget can have multiple order requests linked to it. The project Budget will contain a "Budget" Number field. The Order requests will have a "total order expense ($)" calculated number field. I was hoping someone could help me with a listener script that would sum up all of the linked order "total order expense ($ )" fields in the order requests and subtract them from them from the "budget" field in the project budget and return a "Remaining budget" in the project budget issue type.
Project budget - (total order expense+total order expense+total order expense....) = Remaining budget.