How do I get Target End field (from Advanced Roadmaps) in Epics to show up in Child issues of Epic?

The Target End field (from Advanced Roadmaps) shows up as a customfield for Epics but I want to access this field in Stories through js script to create another custom field.
I have already tried the solution proposed here Epics and Children with Custom Field for Epic - Questions & Answers - eazyBI Community but it did not work.

Thanks,
Dhruv

Hi @dhruvdhingra1
Thanks for posting your question!

Can you please advise what didn’t work with the solution you tried explained in the community post you shared the link for? Screenshots would be useful (from your eazyBI report and the settings you applied in advanced settings). If you don’t feel comfortable sharing them here, you are welcome to contact us directly at support@eazybi.com referring to this community post.

Alternatively, you can also try defining a new calculated measure (Calculated measures) with the formula below and see if this works for you.

CoalesceEmpty(
[Issue].CurrentHierarchyMember.get("Target end"),
[Issue.Advanced Roadmaps].CurrentMember.Parent.get('Target end')
)

Best wishes,

Elita from support@eazybi.com

Hi Elita,

Here is what I am trying to do:
I want to create a custom field “Calculated End Date” to be imported as a dimension. It should take one of the following values in this order:

  1. If a Story has a ‘Target end’, then take that value.
  2. Else, look at all sprints the Story has been part of and use the Sprint end date for the last Sprint the Story is part of.
  3. Else, take the value of the Target End of the parent Epic, if it exists.

I do not wish to do these calculations at the front end to avoid slowing reports down at the execution time. I am using the following code to create the custom field:

var sprints = issue.fields.customfield_10004; // Sprint custom field ID
var sprintEndDate = null;

if (sprints) {
// Iterate over the sprints to find the active one or the one that has the most recent end date
for (var i = 0; i < sprints.length; i++) {
var sprint = sprints[i];

// Parse the sprint data
var sprintAttributes = sprint.match(/\[id=(.*),rapidViewId=(.*),state=(.*),name=(.*),startDate=(.*),endDate=(.*),completeDate=(.*),sequence=(.*)\]/);

if (sprintAttributes && sprintAttributes[6]) {
  // Sprint end date is in position 6 after splitting the attributes
  var endDateStr = sprintAttributes[6];
  
  // Check if the sprint has ended (i.e., has a complete date)
  if (endDateStr && (!sprintEndDate || endDateStr > sprintEndDate)) {
    sprintEndDate = endDateStr;
  }
}

}
}

var targetEndDate = issue.fields.customfield_17503 ? issue.fields.customfield_17503 : null;
var epicLink = issue.fields.customfield_10000 ? issue.fields.customfield_10000 : null;
var parentLink = issue.fields.customfield_17501 ? issue.fields.customfield_17501 : null;
var calculatedEndDate = null;

if (sprintEndDate) {
calculatedEndDate = sprintEndDate;
} else if (targetEndDate) {
calculatedEndDate = targetEndDate;
} else if (epicLink || parentLink) {

// Assuming that the ‘Target End Date’ for the linked epic or parent issue has already been imported to eazyBI

var linkedIssueKey = epicLink || parentLink;

// The next line of code does not work as you can see that Target End Date of the Epic does not appear as property in the Story. Please see the properties field of the test story shared after the code.

var linkedIssueTargetEndDate = issue.properties[linkedIssueKey + ’ customfield_17503’];
if (linkedIssueTargetEndDate) {
calculatedEndDate = linkedIssueTargetEndDate;
}
}

return issue.fields.customfield_calcenddate = calculatedEndDate ? new Date(calculatedEndDate) : null;

I am sharing part of results of this code on a test ‘Story’ issue:
“customfield_calcenddate”: null
},
// The properties field is empty
“properties”: {
“jpo-issue-properties”: {}
},
“changelog”: {
“histories”:
}
}

So, how do I access ‘Target End Date’ from Epic in a Story object? Please let me know if there is another way to accomplish it.