Create jira ticket for new failed tests

Hi All,

I am trying to find the easiest way to create jira ticket in case a NEW test is failed in the build. Is there any option provided by Teamcity for the purpose?? if not, what would be the easiest way. We need to monitor the failed test cases on daily basis and I want to automate this so that a new jira ticket is created everything there is a new failed test in the build.

Thank you very much,

6 comments
Comment actions Permalink

Hi Kumar

There is no direct way to create such tickets. You could develop a custom plugin, but the idea doesn't seem practical. Tests fail quite often, and maintenance of these bugs will add burden to your developers.
TeamCity provides statistics and history for builds and specific tests. Also, this data can be exported by REST API.

Could you explain in more details, what kind of daily report you are looking for?

Thanks

0
Comment actions Permalink

hello Michael,

Idea is to create the jira ticket only when a new test is failed. So, in jira ticket description we could put the name of tests failing.
Actually I wanted to do this only for one build, that build runs once in a day. So for such builds, it is not impractical to have automated monitoring and automated jira ticket creation.
I will look into REST API, however I never used it in teamcity. Is there a way to get the complete build status (with failed test names and information whether the failed tests are new) from a build.

Also, my current version of jira provides SOAP/cli using which I can create the tickets automatically but I am not sure how to link that to teamcity build. Any idea??

Thank you very much,
Kumar

0
Comment actions Permalink

@Kumar, which version of Jira are you using? I was going to look into automated ticket creation as well. Do you already have it working from outside of TC? (My use case is for outside TC.)

0
Comment actions Permalink

I'm able to create a Jira ticket with Jira Python CLI.

You make your build to execute Jira Python CLI command when test fails.

0
Comment actions Permalink

Creating jira ticket is not an issue, I create it in several projects.
The problem for me is to get the detailed failure message (including the name of dependencies failed, name of the tests failed in dependencies and the information that the failure is new or not) from teamcity if a build fails.
Situation is like following:
lets say we have four build configurations..
build configuration 1
build configuraiton 2
build configuration 3
main build

Now main build has dependencies for build configuration , build configuration 2, build configuration 3. We run main build once every day at a scheduled time with scheduled build triggering so all build configurations are executed at that time. Now, I want to configure or add an extra step in the main build so that if any dependency has failed, I should be able to create a jira ticket automatically with the name of tests failed in that dependency if the test failed is new. Creating jira ticket here is not a problem, we can create that with rest api/ soap or cli.. Main issue is to get all information about the dependency failure, then the tests failure in the dependencies and the information that the test failed is new. I don't know if it is  possible with teamcity api. Is there any way to collect this information...

Thanks a lot..

0
Comment actions Permalink

We are using Jira 4.3 and for this version soap api is the best to use except if you want to create subtasks/subissues. This is possible only after version 4.4.
If you are at Jira 5.x then rest api is the best to use.

I am using Jira cli because I have Jira 4.3 and we need to create subtasks which is not possible in soap/rest at this version.

which Jira version do you have and what kind of ticket do you want to generate automatically. small example?? then I can suggest you better.

0

Please sign in to leave a comment.