It's all about the answers!

Ask a question

Retrieve user which perform a change-state action


Michele Pegoraro (1.8k12116103) | asked Sep 17 '09, 11:20 a.m.
I'd like to catch the user which requires a change-state action using a pre-condition plugin on save work item operation.
I can't find a way to catch an IContributorHandle, because I've tried IWorkItem.getModifiedBy() but on pre-condition it has not been set yet.
I was looking for some ISaveParameter methods, but none can give IContributor...
Does someone tried it??

2 answers



permanent link
Marcel Bihr, Jazz Work Item team (1.4k) | answered Sep 18 '09, 3:38 a.m.
JAZZ DEVELOPER
Hi
You can get the user that is executing the operation from:
saveParameter.getSaveOperationParameter().getAuditableCommon().getUser()

The saveparameter is passed in as 'operation.getOperationData()'; you can just cast (after an instanceof check) to ISaveParameter.

Regards

Marcel
Jazz Work Item team

permanent link
Michele Pegoraro (1.8k12116103) | answered Sep 18 '09, 8:17 a.m.
Thank you very much. It works correctly.


Best Regards,
Michele.

Your answer


Register or to post your answer.