Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Structure Formula: accessing sprint endDate values

Mate Moldovan April 22, 2024

Structure:

  • We’re using Sprints with startDate and endDate.
  • We have Tasks allocated in Sprints.
  • Tasks have an ancestor link, to an issueType called Goalpost to indicate where the Task is scheduled to be worked on. Goalposts have startDate and dueDate values.
  • Interesting thing to mention is that when doing this in an Automation, instead of ancestor link, I had to call the opposite, descendant of link.

Formula:

  • We’re trying to access the dueDate value of the Task’s Goalpost, to tell us if it falls inside the Sprint’s endDate or if it’s past. We will use Markdown Format to color code the Task in the Formula’s column.

 

My Formula:

var Goalpost_dueDate = linkedIssues().filterBy(issueLinkType("descendant of")).filterBy(issueType("Goalpost")).dueDate;


var Sprint_endDate = issue.fields.sprint.endDate;

if Sprint_endDate > Goalpost_dueDate : "panel[Late Work]{backgroundColor = orange}"

 

Questions:

  • how do I access the current task's sprint endDate value?
  • the Formula Editor tells me that I haven't defined my variables. How do I do that?

 

Any answers are much appreciated!

3 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Mate Moldovan April 30, 2024

Thank you both, we are now able to get the sprint start and end date for a given task by using:

  • sprint.startDate
  • sprint.endDate

 

What remains now is to get the linkedIssues().filterBy(issueLinkType("descendant of")).filterBy(issueType("Goalpost"))

 

The "descendant of" linkType appears in red, so it seems the problem will be there. @Stepan Kholodov _Tempo_ do you know if this linkType is supported in Formula? Couldn't find it in the documentation.

0 votes
Stepan Kholodov _Tempo_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 22, 2024

Hello @Mate Moldovan 

If you only have Tasks in your structure, then the described is not possible at this time. The issueLinks function of the Formula column currently has access to only a handful of fields; Duse Date and attributes of Sprints not included.

If you add Goalposts under their linked Tasks in the structure using the Linked Items extender, then you won't need to extract values of Goalposts through the issueLinks function, and you'll be able to get them directly. In this setup, you can use a formula like this:

if sprint.enddate > max#children{duedate}: ":panel[Late Work]{backgroundColor = orange}"

The Formula will check the Task's own Sprint End Date and compare it with the Due Date of its children(Goalpost), based on the existing hierarchy in the structure.

I hope this helps. If you need further assistance or have other questions about Structure, please reach out to us directly at our support portal.

Best regards,
Stepan
Tempo (the Structure app vendor)

0 votes
Matt Parks
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 22, 2024

I think you need to put .toDate() at the end of your Sprint_endDate variable.

 

var Sprint_endDate = issue.fields.sprint.endDate.toDate()

 

Although I'm looking at it more from the perspective of a groovy Scriptrunner script, not a Structure formula, so I'm not 100% that this is correct (I haven't tried it out in my environment)

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events