Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi,
I am retrieving the Test Cases from Test Session(sessionId) using the code below.
It generates an exception when the "Tests as of Date" (sessionAsOfDate) is older than the creation date of the test session.
The exception generated is MKS124584: Request for item(s) <ID> prior to their creation
Any idea how I could get this working for any value of "Tests As Of Date" ?
I have seen these articles
https://www.ptc.com/en/support/article/CS145501
https://www.ptc.com/en/support/article/CS290554
I cannot use the solution proposed by CS145501 because I am not allowed by regulations to change the dates.
The solution of CS290554 is not related to the api.
Thanks,
Leandro
========================================================================
Command cmdTestCases = new Command(Command.IM, "relationships");
cmdTestCases.addOption(new Option("expandRelationshipFields", "Tests,References,Contains"));
cmdTestCases.addOption(new Option("fields", "Category,Type," + fldIsMeaningful + ",Text::rich,Expected Results::rich"));
if (sessionAsOfDate != null) {
cmdTestCases.addOption(new Option("asof", dfDayTime.format(sessionAsOfDate.toInstant())));
}
cmdTestCases.addSelection(sessionId);
Response responseTestCases = executeCmd(cmdTestCases);
=================================
Please us the "tm" commands instead "im".
I think "tm testcases" is what you are looking for.