How to deploy a simple Release Note (changelog) with teamcity and youtrack?

Hello,

we have teamcity 9.1.7 and youtrack 6.5 (willing to update if necessary).

We would like to produce a simple txt-file as a build step or differently. And then include this file within the deployed artifacts.

Any easy/quick solution would be very welcome

thanks a lot

Harry, Argos Art

0
9 comments

The easiest way is probably to create a script that uses Youtrack's REST API to get the issue list applying the appropriate filtering (https://www.jetbrains.com/help/youtrack/standalone/Get-the-List-of-Issues.html), then parse it as you need, and publish that output as an artifact.

1

Thank you, you mean e.g. via Powershell Skript and execute as a build step, right?

0

Hi there, some feedback and a follow-up question:

I have managed to produce the text file for the release-notes. Shall I post the code?

We have updated to YT 2017.2 - Great work.

Now how would you filter for the fixed issues in this last build, when youtrack is updating the "Fixed in Build" field independently (eg. too late) from this ongoing build-process in TC? I have tried with the {Next Build} Value, but unfortunately there are too many issues (older ones) that will never change this {Next Build} value.

0

Hello! Regarding your YouTrack question: to search for the fixed issues you can search for `State: Fixed` or just `#Resolved`.

If you'd like to specify a particular build, you can search for `Fixed in Build: {build_number}`, please note that you can search for ranges of builds, like this: `Fixed in Build: v.1 .. v.10`.

Search reference can be found here: https://www.jetbrains.com/help/youtrack/incloud/2017.2/Search-and-Command-Attributes.html

Please let me know if you have any further questions. Thanks!

-1

Also if you can share the script code, it might help other people that come here looking for help.

0

Here's my Code for Creation of Release Note:

#Get List of issues for
#1. FIXED in this Build
#2. Still under REVIEW

$uri = "http://.............../rest/issue?filter=project: TEST Fixed in build: {Next Build} state: DONE order by:Priority"
$token = "Bearer perm:..................................................................................................................................."
$response = Invoke-RestMethod -Method Get -Uri $uri -Headers @{Authorization = $token; Accept = "application/json"} -Verbose

#Datentypen:
# $response ... PSCustomObject
# $response.issue ... Array
# $response.issue[0] ... PSCustomObject
# $response.issue[0].field ... Array
# $response.issue[0].field[0] ... PSCustomObject

$issues = $response.issue
$output = ""
ForEach ($issue in $issues) {
$fields = $issue.field
$hash = @{}
ForEach ($field in $fields) {
$hash[$field.name] = $field.value
}
$output += $hash.projectShortName + "-" + $hash.numberInProject + ": " + $hash.summary + " `r`n"
}
Out-File -FilePath C:\Users\Harry\Desktop\releasenotes.txt -InputObject $output

0

Still my problem persists.

@Liubov: I know how to filter in YT. As I wrote, my problem is that during the TC Build-Process the {Fixed in Build} Field in YT is NOT YET Updated. 

So

a) how to filter Fixed Issues without Update of the {Fixed in Build} Field OR

b) trigger the YT-"Pull fresh Data" Command in TC-Integration?

0

Hello!

a) For example, filter like this: `#Fixed has: -{Fixed in Build}`.

b) We can recommend you to set a smaller interval in the TeamCity integration settings.

0

Please sign in to leave a comment.