Forums

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

Structure how to count number of changes to a field

Mauro Bennici November 10, 2023

greetings, 

I am using history on structure, and I am trying to count the occurrences of a field's history but I get some issues. 

using a simple 

history.changes
.FILTER($.field = "Status")

I get all the status changes in the field: 

Status -> to do, Status -> in progress etc.

I need to count the number of changes, but if I simply wrap the formula in a COUNT it gives weird results (i.e. 3 status changes but the count says 10).

How can I fix it? 

thanks

2 answers

1 vote
Valerie Knapp
Community Champion
November 10, 2023

Hi @Mauro Bennici , thanks for your question.

You can also reach out directly to the vendor of Structure, who should be experts on how the product works - Structure by Tempo - Jira Portfolio Management & PPM | Atlassian Marketplace

Hope this helps.

Cheers

Stepan Kholodov _Tempo_
Community Champion
November 10, 2023

Hello @Mauro Bennici 

The COUNT aggregate function indeed won't work here - such functions can only aggregate data from multiple items in the structure - e.g. counting the number of or the sum of Story Points of all child issues etc.

In your case, you need to count the number of transitions in a single issue in the same field. This formula should do it:

history.changes.FILTER($.field = "Status").size()

I hope this helps. If you need further assistance, please reach out to us directly at our support portal.

Best regards,
Stepan Kholodov
Tempo (The Structure app vendor)

Like # people like this
Mauro Bennici November 10, 2023

thanks! It works!

Like # people like this
Saurabh Kejriwal July 18, 2024

Works like a charm. many thanks Stepan and Mauro

Like Stepan Kholodov _Tempo_ likes this
0 votes
Veronica Ibragimova
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2024

How can I use this Formula if I want to take into account changes only when the issue was in specific statuses? 

 

Stepan Kholodov _Tempo_
Community Champion
June 13, 2024

@Veronica Ibragimova 

You can count only specific transitions with a formula like this:

history.changes.FILTER($.field = "Status" and $.to = "status name").size()

If you have more questions about formulas or Structure in general, please reach out to us directly at our portal.

Best regards,
Stepan

Like Valerie Knapp likes this

Suggest an answer

Log in or Sign up to answer