How do I display the value of a field from an Epic on the children?

Karsten Stork November 5, 2020

Hello!

We have Scriptrunner. What I want to do is take the value of a scripted field from the epic, and display that value in a different field on all children. The field has to update when the scripted Epic field updates (using a listener?).

 

Details:

We sell hourly professional services budgets.

I have a scripted field on the Epic (which represents one (1) budget) which takes all logged work from all children and subtracts it from the Epics Original Estimate. We use the Original Estimate to enter the amount of hours sold. I have a listener set up to look for work log changes and triggering a re-index. This works perfectly.

Now I want to display this value (how much time is left in the whole budget (Epic)) on each child (as a different field with a different name), so that people don't have to navigate the issue tree to check how much time they can still log until the Epic runs out.

 

My attempt so far:

I copy pasted different old solutions to similar problems, especially traversing each "Epic-Story Link" relation and storing the found Object to refer to in a linkedIssue variable. Like I did when implementing the first scripted field.

However, this seems to point me at the "Issue" interface, which for some reason cannot access getCustomFieldValue($FOO) method.

Weirdly enough, the other methods work. Like getOriginalEstimate() and stuff. 

I have no working code to show for this.

0 answers

Suggest an answer

Log in or Sign up to answer