Auto creation of issues in JIRA after execution failure

All,
Is there a way to auto create an issue in JIRA when the execution fails. I dont believe there is such a feature in katalon. Hence Im trying to explore the aftermethod/aftertestcase hooks to update JIRA. Has any body done that?

used rest api interface

Do you have an example?

https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/

{
“fields”: {
“project”:
{
“key”: “TEST” // this should be your project key
},
“summary”: “REST ye merry gentlemen.”,
“description”: “Creating of an issue using project keys and issue type names using the REST API”,
“issuetype”: {
“name”: “Bug”
}
}
}