Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi all,
I am investigating the option to create time entries in a trigger context.
Problem:
- we want to use the time tracking feature provided by PTC, but we have strict limitations about the data that shall be visible to the users.
Therefore we cannot just enable "time tracking" on our TASK types, as once enabled this would allow all TASK users to review the time entries of their colleagues.
Only dedicated "time admin" users shall be allowed to do this.
Idea:
I created a separate type "TIMESHEET" that has the time tracking enabled and is automatically generated with a 1:1 relationship to the TASK type.
This TIMESHEET type is only visible to "time admin" users.
The TASK users shall enter their hours in a float field "time send today" inside the TASK item.
A pre-event trigger reads that "time spend today" value from a TASKs IssueDeltaBean, and automatically creates an according TimeEntry in the related TIMESHEET item.
The "time spend today" value is cleared from the IssueDeltaBean and all other changes in the TASK may be stored.
Doing so prevents the "time spend today" value from even being part of the TASK's history.
In theory this seems doable, but currently I'm struggling with the trigger framework.
Does anyone know how I can create / edit a time entry from inside a trigger.
So far I only found ways to read time entries.
All replies are welcome
Solved! Go to Solution.
Hi @awalsh
Thank you for the response.
I used your idea to write a script that utilizes the "im settimentries" command and the trigger API sessions.
It was a bit tricky to get the correct timestamp format for the command, but finally I made it happen.
I works just as expected. (see attached file if you like)
BTW:
What exactly do you mean by "not certified in the API" ?
unfortunately, it's not possible through the trigger beans. And, the im settimeentries command is not certified in the API, though the command may work.
Hi @awalsh
Thank you for the response.
I used your idea to write a script that utilizes the "im settimentries" command and the trigger API sessions.
It was a bit tricky to get the correct timestamp format for the command, but finally I made it happen.
I works just as expected. (see attached file if you like)
BTW:
What exactly do you mean by "not certified in the API" ?
By "not certified in the API", I mean it is not in the list of published commands in the Integrations Builder Guide.
From the guide:
"Every command and command option on the Integrity Lifecycle Manager and Integrity Lifecycle Manager server can be called through the Integrity Lifecycle Manager API. However, PTC supports only published commands for use with the Integrity Lifecycle Manager API."
"Unpublished commands used with the Integrity Lifecycle Manager API do not always return predictable results. Consequently, PTC does not support them."