Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to Read History in Trigger Script.


How to Read History in Trigger Script.


I execute following CLI in script, which gives me response.

var command = new"im", "viewissue");


   ProjectID = 30300;



   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 ?

21-Topaz I

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?



Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
5-Regular Member

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.



Top Tags