Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi,
I execute following CLI in script, which gives me response.
var command = new Packages.com.mks.api.Command("im", "viewissue");
command.addOption(new Packages.com.mks.api.Option("showHistory"));
ProjectID = 30300;
command.addSelection(ProjectID);
var response = api.executeCmd(command);
if(response != null)
{
var status = response.getWorkItems().next();
//want history here
}
I don't know how to read History through it, here I want what modification was done on the project 30300 in last few days.
Is there any method in API Bean instead of CLI ?
Hi Hanumant,
There is an existing enhancement request asking for item history to be exposed via the trigger beans. See RFC 339587 for details and please contact PTC Technical Support to have your organization added to the request.
In the meantime, the only workaround is to use the API as you are already doing.
Edit: If you want to see the API response you should expect, try running the command through the mksapiviewer. Eg:
mksapiviewer --iplocal im viewissue --showHistory 123
Hello Hanumant,
If you found Joe's response useful, could you please let us know by clicking on the Correct Answer button on his post?
If Joe's answer wasn't useful, could you let us know, so that we can see if there is something else we could do to help you?
Thanks,
Kael
Hi Kael,
I've come up against the same problem as hruke, but am unsure what should go where they have written
//want history here
I'm quite happy to use the API as Joe suggested, and have used his mksapiviewer code line to see the response. The response in the command prompt is perfect, listing all of the history etc. However, how can I access this from the response object?
I'm really struggling to find the correct method to extract the history field, any help you can give would be much appreciated.
Thanks