Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find status changes of a subtask in a Structure Formula

Paul Doman
Contributor
December 21, 2022

Hello,

We have been making the most of a recent upgrade to JIRA and Structure. The formula enhancements have been amazing.

I am looking for a way to find status changes within a time range for subtasks:

  • in ordinary JQL I can see which subtasks have changed to "Developed" in the last 7 days, or 8-14 days etc. This uses the "status changed" function
  • in Structure formula I can find the subtasks of interest within the current parent issue

but so far I cannot work out if the development subtask of the current issue changed to "Developed" in the last 7 days.

Thanks for thinking about this and your suggestions.

Paul

 

1 answer

1 accepted

1 vote
Answer accepted
David Niro
Atlassian Partner
December 22, 2022

Hello @Paul Doman ,

This formula should work for you:

IF issuetype = "sub-task":
with _today = today():
with _prev7 = date_subtract(_today,7,"day"):
with _changed = history
.FILTER($.time > _prev7).changes
.FILTER($.toText = "Developed"):
IF _changed != undefined:
"Developed Last 7"

For sub-tasks, it looks at "today" and then subtracts seven days.  From there, we access the history and filter to only include changes made in the past seven days.  We then filter again for those changes that were to "Developed".  If there is a value after the filtering, we then output the text "Developed Last 7".

You can change the output text to whatever you would like, or you could use the Wiki Markup functionality to add some color to it!

Please let me know if this helps.

Best,
David

Paul Doman
Contributor
December 22, 2022 edited

Hi David,

Thanks for your prompt assistance. Unfortunately I omitted a significant fact:

 - to make this a useful management tool, the structure only has parent issues, no subtasks;

- so the formulae probe what is going on in the subtasks using "subtasks.FILTER...." to quite an extent

 - and it works out an overall state of the parent by combining individual subtask status according to our business rules (not for automation purposes, only to show who is the next contributor and what they should be doing - which subtask, and which activity).

 - and the result appears on the parent issue line in the structure:

 

AtlassianCommunity-005.png

The result is that this information - one line per issue on the structure - shows us where things are at, without getting bogged down in the individual subtasks and their status. And if necessary it can be exported to CSV cleanly, without the subtask clutter.

So...

Applying your suggested code to the extended "subtasks.FILTER..." looks like it has solved my problem. That will make life much easier for colleagues.

 

Many thanks

Paul

Suggest an answer

Log in or Sign up to answer