I am looking for an idea to update my automation test cases in JIRA Adaptavist Test Management Tool. The test cases are written in Java & TestNg and are running on a VM. Please suggest what is a good method to update test results(Pass Or Fail) automatically in JIRA Adaptavist Test Management Tool. Currently, we are manually updating results in the tool.

Problem with using Zephyr and XRay or any other thrid-party COTS tool is that because of the cumbersome and delayed approval processes.

I appreciate your time, help and support.

Our Android test team developed the following code and we don't know how to achieve as they did.

Here is the android team's code :


Code:
Open class rTestCaseHelper {

@rule
@JvmField
val grantWriteStorageAccess: GrantPermissionRule = GrantPermissionRule.grant(
android.Manifest.permission.WRITE_EXTERNAL_STORAGE)

@rule
@JvmField
val reportRule :TestWatcher = Object : TestWatcher() {
var startTime = 0
override fun starting(description: Description?) {
startTime = System.currentTimeMillis().toInt()

if (sharedPreference.getTestCount() == 0) {
testManager.getTestIdAndStoreToSharedPreference()
testManager.createTestCycle()
}

}

override fun succeeded(description: Description?) {
if(description != null) {
val executionTime = System.currentTimeMillis().toInt() - startTime
testManager.generateExecutionReport(description.methodName, result: "Pass", executionTime)

}

}

override fun failed(e: Throwable?, description: Description?) {
super.failed(e.description)
if(description != null) {
val executionTime = System.currentTimeMillis().toInt() - startTime
testManager.generateExecutionReport(description.methodName, result: "Fail", executionTime, e)

}

}

override fun finished(description: Description?) {
sharedPreference.setTestCount(sharedPreference.getTestCount() -1)
//Post artfact report link to test cycle (TODO)
testManager.postWebLinkToTestCycle()

rSharedPreference.preference.edit().clear()
Log.d(tag: "QAA", msg: "Automation suite finished and sharedPreference data is cleared!")

}

}

}
fun initializeSDK(activeProtection: Boolean = false): Boolean {
rSdkEnvironment.initializeSDK(activeProtection, InstrumentationRegistry.getInstrumentation().targetContext)
return rSdk.isInitialized() 
}