[midPoint] Get OwnerName in reportQuery

Pavol Mederly mederly at evolveum.com
Tue Oct 22 13:16:30 CEST 2019


Hello,

I have almost no experience with reports, but you could try either

import 
com.evolveum.midpoint.model.impl.expr.ModelExpressionThreadLocalHolder
task = ModelExpressionThreadLocalHolder.getCurrentTask()

or

import 
com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluationContext
ScriptExpressionEvaluationContext.getThreadLocal().getTask()

Hopefully at least one of them would be non-null.

Best regards,

Pavol Mederly
Software developer
evolveum.com

On 22.10.2019 13:03, Peter Holes wrote:
> Hi All,
>
> Is there anybody who can help with my issue?
> What I need to achieve:
> Get a taskOwner (name of the logged user) into report query
>
> My current situation:
> I preparing a report and I need to get the Task OwnerName into the report query.
> I have already build own report (no issue, report is working fine) and
> on the input form is the initiatorName.
> What would like to achieve is, that each user can generate report, but
> I would like to hide field on input form. Instead of manually typing
> value, I'd like to get "name" of the current user = "name" of user who
> runned the report.
>
> On report query there is only "report" object for which are suitable
> ReportFunctions but no "task" or any other similar object to get
> requested data. Maybe I missed something.
> Can anybody point me out, how to get the requested data?
>
> thx for help.
> Peter
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint



More information about the midPoint mailing list