# Change in Changesets

**URL:** https://www.finalbuilder.com/forums/t/change-in-changesets/6209
**Category:** Discussion
**Created:** [September 26, 2018, 2:09pm UTC](https://www.finalbuilder.com/forums/t/change-in-changesets/6209 "2018-09-26T14:09:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [September 26, 2018, 2:09pm UTC](https://www.finalbuilder.com/forums/t/change-in-changesets/6209/1 "2018-09-26T14:09:02Z")

</div>

Hi,

the notification template lists changesets included by the build. However the order of the changesets seems not to be sorted. At least it is different to the changes view of the build. My main concern though, is that it is not possible to recognize on which changeset the build actually was run. What i am looking for is $Source.MyRepo.BuiltChangeset.Id$

How can the template be configured to show the relevant changeset?

Thomas

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [September 27, 2018, 1:02am UTC](https://www.finalbuilder.com/forums/t/change-in-changesets/6209/2 "2018-09-27T01:02:07Z")

</div>

The changesets are not explicitly sorted. We’ll change that for the next update.

Meanwhile you can sort them in the template as follows

```django
{% assign sortedChangeSets = (Changesets | sort: "Created") -%}
{% for change in sortedChangeSets -%}
    {{change.RepositoryName}} / {{change.RepositoryChangeId}} / {{change.Created}} / {{change.Branch}} / {{change.RepositoryUserName}} / {{change.ToBuild}} / {{change.Comment}}
{% endfor -%}

```

We will also add a BuiltChangesets property (note that a build can include changesets from multiple repositories so this will need to be a collection). Meanwhile you can do this:

```django
Built Changesets Revision: {% for change in Changesets -%} {% if change.ToBuild -%}{{change.RepositoryName}}: {{change.RepositoryChangeId}} {% endif -%}{% endfor -%}

```

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [September 28, 2018, 7:30am UTC](https://www.finalbuilder.com/forums/t/change-in-changesets/6209/3 "2018-09-28T07:30:06Z")

</div>

> [@Sparky](#):
>
> The changesets are not explicitly sorted. We’ll change that for the next update.

Great.

…and this text is to make Discourse happy 🙂

Yes i could use the “like” icon. However the icon is related to the complete post, whereas my answer is limited to a part only.

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [September 28, 2018, 7:38am UTC](https://www.finalbuilder.com/forums/t/change-in-changesets/6209/4 "2018-09-28T07:38:41Z")

</div>

> [@Sparky](#):
>
> ```django
> Built Changesets Revision: {% for change in Changesets -%} {% if change.ToBuild -%}{{change.RepositoryName}}: {{change.RepositoryChangeId}} {% endif -%}{% endfor -%}
> 
> ```

As i only want the one and only relevant changeset i did the following:

```django
{% assign sortedChangeSets = (Changesets | sort: "Created") -%}
{% for change in sortedChangeSets reversed -%}
    {% if change.ToBuild -%}
        {{change.RepositoryChangeId}}
        {% break %}
    {% endif -%}
{% endfor -%}

```

I also applied this function to get the relevant branch name. I want exactly the same information that i get by these variables:  
$Source.MyRepo.BuiltChangeset.Id$  
$Source.MyRepo.BranchName$

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [October 10, 2018, 7:50am UTC](https://www.finalbuilder.com/forums/t/change-in-changesets/6209/5 "2018-10-10T07:50:11Z")

</div>

> [@Sparky](#):
>
> We will also add a BuiltChangesets property (note that a build can include changesets from multiple repositories so this will need to be a collection).

Build 205 now supports the “BuildChangesets”.

The properties are the same as with the regular “Changesets”, right?  
However, i understand that “ToBuild” is always TRUE for BuildChangesets, right?  
Are there any other differences?

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [October 10, 2018, 11:18am UTC](https://www.finalbuilder.com/forums/t/change-in-changesets/6209/6 "2018-10-10T11:18:51Z")

</div>

Hi Thomas,

The BuiltChangesets is the list of Changesets filtered to those with the “Built” flag set to True. The ToBuild flag is actually used internally to signal which changesets to build. The Built flag marks which changeset is built.

There may be multiple ToBuild changesets per repository if, for example, a new changeset is detected while a build is waiting in a Quiet Period. There is only ever one Built changeset per repository.

Prior to version 1.9.0.205 the Built flag was not populated correctly, so I suggested using ToBuild in my previous post.

Each changeset in BuiltChangesets has the exact same properties as each changeset in Changesets, as shown in the Available Variables sidebar.
