Forum Discussion

jawed's avatar
jawed
Occasional Contributor
7 years ago

create issue in jira using API using event handler when Testcase get Failed

I want to create issue in Jira with JIRA API using Event handler in SOAP UI. I want to Run JIRA API to create issue in JIRA after the Test Case get failed. I have tried but i am failed how to get status/result of Test Case. So please help me achieve this.

 

Event Handler TestSuiteRunListener.afterTestCase

 

if (Test case status = Failed)

Run Jira Rest Api Request step to create issue

 

  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    SmartBear Alumni (Retired)

    Hi Jawed,

     

    Thank you for your post. I would recommend that you use the TestSuite TearDown script and the following Groovy script:

     

    for ( testCaseResult in runner.results )
    {
    if( testCaseResult.getStatus().toString() == 'FAILED' ) { // do something log.info "testCase has failed" } }