Ask a Question

How to invoke a REST API (e.g. JIRA REST API) when a test case assertion fails?

SOLVED
bcoelho2000
New Contributor

How to invoke a REST API (e.g. JIRA REST API) when a test case assertion fails?

Hi everyone!

The title is self-explanatory but basically what I want to do is to call/invoke a REST API (in this case from JIRA) whenever a test case fails (assertion is different from what is expected).

 

Help?

1 ACCEPTED SOLUTION

Accepted Solutions
bcoelho2000
New Contributor

Re: How to invoke a REST API (e.g. JIRA REST API) when a test case assertion fails?

I was looking for "as soon as the assert fails". 

 

What I did was using a "Conditional GO" after the assert and then jump to a final step (just a delay step). If the assert fails, the Conditional GO will also fail, therefore it will execute the next step which is a REST API call to JIRA. Else, it will jump over the REST API call straight to the Delay step

View solution in original post

3 REPLIES 3
HKosova
Moderator

Re: How to invoke a REST API (e.g. JIRA REST API) when a test case assertion fails?

Do you mean at the end of a test case, or as soon as any assertion fails? These are different things - a failed assertion does not necessarily stop the test (it depends on the test case option "Abort test of an error occurs").


Helen Kosova
SmartBear Documentation Team Lead
________________________
nmrao
Community Hero

Re: How to invoke a REST API (e.g. JIRA REST API) when a test case assertion fails?

JIRA provides rest api, one of them is create issue, using which you should be able to achieve what you are looking for. You can look at jira rest api documentation for the details.


Regards,
Rao.
bcoelho2000
New Contributor

Re: How to invoke a REST API (e.g. JIRA REST API) when a test case assertion fails?

I was looking for "as soon as the assert fails". 

 

What I did was using a "Conditional GO" after the assert and then jump to a final step (just a delay step). If the assert fails, the Conditional GO will also fail, therefore it will execute the next step which is a REST API call to JIRA. Else, it will jump over the REST API call straight to the Delay step

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: